Added ~ handling to getDirectoryName.

This commit is contained in:
Jeremy Fincher 2003-09-30 10:19:20 +00:00
parent 4ccd2291df
commit b5c5262878
1 changed files with 1 additions and 3 deletions

View File

@ -107,9 +107,7 @@ def getDirectoryName(default):
'[defaults to %s]' % os.path.join(os.curdir, default))
if not dir:
dir = default
if '~' in dir:
if 'HOME' in os.environ:
dir = dir.replace('~', os.getenv('HOME'))
dir = os.path.expanduser(dir)
dir = os.path.abspath(dir)
try:
os.makedirs(dir)