From: Tarek Ziadé Date: Wed, 5 May 2010 22:41:25 +0000 (+0000) Subject: removed non needed lines X-Git-Tag: v2.7b2~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31a673da52dcc5cbf2a25dd732de3ee389a4a319;p=python removed non needed lines --- diff --git a/Lib/shutil.py b/Lib/shutil.py index f02a2d9e70..1d86df36c2 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -67,8 +67,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) @@ -79,6 +77,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)