| commit | e294cf620aa0dc6e51afa2e54d213ae6526ec5bc | [log] [tgz] |
|---|---|---|
| author | Guido van Rossum <[email protected]> | Fri Jan 29 18:05:18 1999 +0000 |
| committer | Guido van Rossum <[email protected]> | Fri Jan 29 18:05:18 1999 +0000 |
| tree | b875491fcdf656bc8d3fb021dec8ef3ebbef3b94 | |
| parent | 1804dc3c071cca9c420b41ee8feee3bb74dbfc89 [diff] [blame] |
Add abspath()
diff --git a/Lib/macpath.py b/Lib/macpath.py index 68dd6d4..b19d5a1 100644 --- a/Lib/macpath.py +++ b/Lib/macpath.py
@@ -212,3 +212,10 @@ name = join(top, name) if isdir(name): walk(name, func, arg) + + +# Return an absolute path. +def abspath(path): + if not isabs(path): + path = join(os.getcwd(), path) + return normpath(path)