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
cfcc9779
Commit
cfcc9779
authored
Aug 10, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused names in except clauses
parent
25785e9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Lib/shutil.py
Lib/shutil.py
+3
-3
No files found.
Lib/shutil.py
View file @
cfcc9779
...
...
@@ -267,7 +267,7 @@ def rmtree(path, ignore_errors=False, onerror=None):
names
=
[]
try
:
names
=
os
.
listdir
(
path
)
except
os
.
error
as
err
:
except
os
.
error
:
onerror
(
os
.
listdir
,
path
,
sys
.
exc_info
())
for
name
in
names
:
fullname
=
os
.
path
.
join
(
path
,
name
)
...
...
@@ -280,7 +280,7 @@ def rmtree(path, ignore_errors=False, onerror=None):
else
:
try
:
os
.
remove
(
fullname
)
except
os
.
error
as
err
:
except
os
.
error
:
onerror
(
os
.
remove
,
fullname
,
sys
.
exc_info
())
try
:
os
.
rmdir
(
path
)
...
...
@@ -323,7 +323,7 @@ def move(src, dst):
raise
Error
(
"Destination path '%s' already exists"
%
real_dst
)
try
:
os
.
rename
(
src
,
real_dst
)
except
OSError
as
exc
:
except
OSError
:
if
os
.
path
.
isdir
(
src
):
if
_destinsrc
(
src
,
dst
):
raise
Error
(
"Cannot move a directory '%s' into itself '%s'."
%
(
src
,
dst
))
...
...
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