Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Unified Diff: Lib/shutil.py

Issue 2384: Remove WindowsError reference on non-windows systems (Closed) SVN Base: http://svn.python.org/view/*checkout*/python/trunk/
Patch Set: A slight mistake corrected. Created 1 year, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side by-side-diff with in-line comments
Download patch
« no previous file | no next file » | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Lib/shutil.py
===================================================================
--- Lib/shutil.py (revision 64406)
+++ Lib/shutil.py (working copy)
@@ -15,6 +15,11 @@
class Error(EnvironmentError):
pass
+try:
+ WindowsError
+except NameError:
+ WindowsError = None
+
def copyfileobj(fsrc, fdst, length=16*1024):
"""copy data from file-like object fsrc to file-like object fdst"""
while 1:
@@ -131,11 +136,12 @@
errors.extend(err.args[0])
try:
copystat(src, dst)
- except WindowsError:
- # can't copy file access times on Windows
- pass
except OSError, why:
- errors.extend((src, dst, str(why)))
+ if WindowsError is not None and isinstance(why, WindowsError):
+ # Copying file access times may fail on Windows
+ pass
+ else:
+ errors.extend((src, dst, str(why)))
if errors:
raise Error, errors
« no previous file | no next file »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r483