[Python-checkins] cpython (merge 3.2 -> 3.3): Issue 16646 (ftplib): deliberately use intermediate variable after catching

giampaolo.rodola python-checkins at python.org
Mon Dec 17 20:47:36 CET 2012


http://hg.python.org/cpython/rev/da161499d0c0
changeset:   80918:da161499d0c0
branch:      3.3
parent:      80911:6d805653843a
parent:      80917:dcefa2c8386b
user:        Giampaolo Rodola' <g.rodola at gmail.com>
date:        Mon Dec 17 20:46:29 2012 +0100
summary:
  Issue 16646 (ftplib): deliberately use intermediate variable after catching exception

files:
  Lib/ftplib.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/ftplib.py b/Lib/ftplib.py
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -295,7 +295,8 @@
             try:
                 sock = socket.socket(af, socktype, proto)
                 sock.bind(sa)
-            except socket.error as err:
+            except socket.error as _:
+                err = _
                 if sock:
                     sock.close()
                 sock = None

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list