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
d66f965c
Commit
d66f965c
authored
Mar 29, 2000
by
Greg Ward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documented Bastian's patch.
Made handling OSError in 'mkpath()' more standard.
parent
8cb8167e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
Lib/distutils/util.py
Lib/distutils/util.py
+9
-7
No files found.
Lib/distutils/util.py
View file @
d66f965c
...
@@ -24,11 +24,13 @@ PATH_CREATED = {}
...
@@ -24,11 +24,13 @@ PATH_CREATED = {}
# succeed in that case).
# succeed in that case).
def
mkpath
(
name
,
mode
=
0777
,
verbose
=
0
,
dry_run
=
0
):
def
mkpath
(
name
,
mode
=
0777
,
verbose
=
0
,
dry_run
=
0
):
"""Create a directory and any missing ancestor directories. If the
"""Create a directory and any missing ancestor directories. If the
directory already exists, return silently. Raise
directory already exists (or if 'name' is the empty string, which
DistutilsFileError if unable to create some directory along the
means the current directory, which of course exists), then do
way (eg. some sub-path exists, but is a file rather than a
nothing. Raise DistutilsFileError if unable to create some
directory). If 'verbose' is true, print a one-line summary of
directory along the way (eg. some sub-path exists, but is a file
each mkdir to stdout."""
rather than a directory). If 'verbose' is true, print a one-line
summary of each mkdir to stdout. Return the list of directories
actually created."""
global
PATH_CREATED
global
PATH_CREATED
...
@@ -71,9 +73,9 @@ def mkpath (name, mode=0777, verbose=0, dry_run=0):
...
@@ -71,9 +73,9 @@ def mkpath (name, mode=0777, verbose=0, dry_run=0):
try
:
try
:
os
.
mkdir
(
head
)
os
.
mkdir
(
head
)
created_dirs
.
append
(
head
)
created_dirs
.
append
(
head
)
except
os
.
error
,
(
errno
,
errstr
)
:
except
OSError
,
exc
:
raise
DistutilsFileError
,
\
raise
DistutilsFileError
,
\
"could not create '%s': %s"
%
(
head
,
e
rrstr
)
"could not create '%s': %s"
%
(
head
,
e
xc
[
-
1
]
)
PATH_CREATED
[
head
]
=
1
PATH_CREATED
[
head
]
=
1
return
created_dirs
return
created_dirs
...
...
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