From e294cf620aa0dc6e51afa2e54d213ae6526ec5bc Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 29 Jan 1999 18:05:18 +0000 Subject: Add abspath() --- Lib/macpath.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Lib/macpath.py') diff --git a/Lib/macpath.py b/Lib/macpath.py index 68dd6d48cc..b19d5a1f66 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) -- cgit v1.2.1