Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2e2ac925
Commit
2e2ac925
authored
Jan 29, 1999
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add abspath()
parent
04332931
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
0 deletions
+28
-0
Lib/dospath.py
Lib/dospath.py
+7
-0
Lib/macpath.py
Lib/macpath.py
+7
-0
Lib/ntpath.py
Lib/ntpath.py
+7
-0
Lib/posixpath.py
Lib/posixpath.py
+7
-0
No files found.
Lib/dospath.py
View file @
2e2ac925
...
...
@@ -332,3 +332,10 @@ def normpath(path):
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
)
Lib/macpath.py
View file @
2e2ac925
...
...
@@ -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
)
Lib/ntpath.py
View file @
2e2ac925
...
...
@@ -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
)
Lib/posixpath.py
View file @
2e2ac925
...
...
@@ -367,3 +367,10 @@ def normpath(path):
if
not
comps
and
not
slashes
:
comps
.
append
(
'.'
)
return
slashes
+
string
.
joinfields
(
comps
,
'/'
)
# Return an absolute path.
def
abspath
(
path
):
if
not
isabs
(
path
):
path
=
join
(
os
.
getcwd
(),
path
)
return
normpath
(
path
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment