1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Resolve dirname given a log filename like 'foo.log'. Fixes #90.

This commit is contained in:
Alexandre Conrad 2010-04-19 11:28:33 +02:00
parent 3a419a21a3
commit 1397f923a5

View file

@ -188,6 +188,7 @@ def open_logfile(filename, mode='a'):
the file to separate past activity from current activity.
"""
filename = os.path.expanduser(filename)
filename = os.path.abspath(filename)
dirname = os.path.dirname(filename)
if not os.path.exists(dirname):
os.makedirs(dirname)