mirror of
https://github.com/python/cpython.git
synced 2025-10-12 18:02:39 +00:00
Add abspath()
This commit is contained in:
parent
1804dc3c07
commit
e294cf620a
4 changed files with 28 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue