summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2010-05-05 22:43:04 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2010-05-05 22:43:04 (GMT)
commitb01142b5dc69611a5e37789e2b81995ad89b2cf5 (patch)
treeaf69e8ba0629fabbbfa72ff8d06fd6604797b7b4 /Lib/shutil.py
parent85b53533e499f5d1968896f846fd43b9ec8f1e0e (diff)
downloadcpython-b01142b5dc69611a5e37789e2b81995ad89b2cf5.zip
cpython-b01142b5dc69611a5e37789e2b81995ad89b2cf5.tar.gz
cpython-b01142b5dc69611a5e37789e2b81995ad89b2cf5.tar.bz2
Merged revisions 80837 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r80837 | tarek.ziade | 2010-05-06 00:41:25 +0200 (Thu, 06 May 2010) | 1 line removed non needed lines ........
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 74a4db8..44c8ac3 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -84,8 +84,6 @@ def copyfile(src, dst):
if _samefile(src, dst):
raise Error("`%s` and `%s` are the same file" % (src, dst))
- fsrc = None
- fdst = None
for fn in [src, dst]:
try:
st = os.stat(fn)
@@ -96,6 +94,7 @@ def copyfile(src, dst):
# XXX What about other special files? (sockets, devices...)
if stat.S_ISFIFO(st.st_mode):
raise SpecialFileError("`%s` is a named pipe" % fn)
+
with open(src, 'rb') as fsrc:
with open(dst, 'wb') as fdst:
copyfileobj(fsrc, fdst)