summaryrefslogtreecommitdiffstats
path: root/Lib/macpath.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-01-29 18:05:18 (GMT)
committerGuido van Rossum <guido@python.org>1999-01-29 18:05:18 (GMT)
commite294cf620aa0dc6e51afa2e54d213ae6526ec5bc (patch)
treeb875491fcdf656bc8d3fb021dec8ef3ebbef3b94 /Lib/macpath.py
parent1804dc3c071cca9c420b41ee8feee3bb74dbfc89 (diff)
downloadcpython-e294cf620aa0dc6e51afa2e54d213ae6526ec5bc.zip
cpython-e294cf620aa0dc6e51afa2e54d213ae6526ec5bc.tar.gz
cpython-e294cf620aa0dc6e51afa2e54d213ae6526ec5bc.tar.bz2
Add abspath()
Diffstat (limited to 'Lib/macpath.py')
-rw-r--r--Lib/macpath.py7
1 files changed, 7 insertions, 0 deletions
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 @@ def walk(top, func, arg):
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)