diff options
author | Guido van Rossum <guido@python.org> | 1999-01-29 18:05:18 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-01-29 18:05:18 +0000 |
commit | e294cf620aa0dc6e51afa2e54d213ae6526ec5bc (patch) | |
tree | b875491fcdf656bc8d3fb021dec8ef3ebbef3b94 /Lib/dospath.py | |
parent | 1804dc3c071cca9c420b41ee8feee3bb74dbfc89 (diff) | |
download | cpython-git-e294cf620aa0dc6e51afa2e54d213ae6526ec5bc.tar.gz |
Add abspath()
Diffstat (limited to 'Lib/dospath.py')
-rw-r--r-- | Lib/dospath.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/dospath.py b/Lib/dospath.py index a956c09269..d7aa75246c 100644 --- a/Lib/dospath.py +++ b/Lib/dospath.py @@ -332,3 +332,10 @@ def normpath(path): comps.append('.') return prefix + string.joinfields(comps, os.sep) + + +# Return an absolute path. +def abspath(path): + if not isabs(path): + path = join(os.getcwd(), path) + return normpath(path) |