Skip to content

Commit 3e4019a

Browse files
committed
Support '~' by using expanduser from os.path
1 parent 1f614be commit 3e4019a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

about_code_tool/genattrib.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import optparse
3030
import sys
3131

32-
from os.path import exists, dirname, join, abspath, isdir, basename
32+
from os.path import exists, dirname, join, abspath, isdir, basename, expanduser
3333

3434
from about import Collector
3535
import genabout
@@ -183,7 +183,8 @@ def main(parser, options, args):
183183
sys.exit(errno.EEXIST)
184184

185185
if template_location:
186-
if not exists(template_location):
186+
template_location = abspath(expanduser(template_location))
187+
if not exists(expanduser(template_location)):
187188
print('The defined template location does not exist.')
188189
parser.print_help()
189190
sys.exit(errno.EINVAL)

0 commit comments

Comments
 (0)