commit | e294cf620aa0dc6e51afa2e54d213ae6526ec5bc | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Fri Jan 29 18:05:18 1999 +0000 |
committer | Guido van Rossum <guido@python.org> | Fri Jan 29 18:05:18 1999 +0000 |
tree | b875491fcdf656bc8d3fb021dec8ef3ebbef3b94 | |
parent | 1804dc3c071cca9c420b41ee8feee3bb74dbfc89 [diff] [blame] |
Add abspath()
diff --git a/Lib/posixpath.py b/Lib/posixpath.py index fb3b6a6..36edc80 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py
@@ -367,3 +367,10 @@ if not comps and not slashes: comps.append('.') return slashes + string.joinfields(comps, '/') + + +# Return an absolute path. +def abspath(path): + if not isabs(path): + path = join(os.getcwd(), path) + return normpath(path)