mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
Add abspath()
This commit is contained in:
parent
1804dc3c07
commit
e294cf620a
4 changed files with 28 additions and 0 deletions
|
@ -365,3 +365,10 @@ def normpath(path):
|
|||
if not prefix and not comps:
|
||||
comps.append('.')
|
||||
return prefix + string.joinfields(comps, os.sep)
|
||||
|
||||
|
||||
# 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