![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
Author: benjamin.peterson Date: Wed Dec 31 05:08:55 2008 New Revision: 68092 Log: fix name collision issues Modified: python/trunk/Lib/ssl.py Modified: python/trunk/Lib/ssl.py ============================================================================== --- python/trunk/Lib/ssl.py (original) +++ python/trunk/Lib/ssl.py Wed Dec 31 05:08:55 2008 @@ -74,7 +74,7 @@ SSL_ERROR_EOF, \ SSL_ERROR_INVALID_ERROR_CODE -from socket import socket, _fileobject +from socket import socket, _fileobject, error as socket_error from socket import getnameinfo as _getnameinfo import base64 # for DER-to-PEM translation @@ -103,7 +103,7 @@ # see if it's connected try: socket.getpeername(self) - except socket.error: + except socket_error: # no, no connection yet self._sslobj = None else: @@ -441,7 +441,7 @@ PROTOCOL_SSLv23, None) try: sock.getpeername() - except socket.error: + except socket_error: # no, no connection yet pass else:
![](https://secure.gravatar.com/avatar/0a2191a85455df6d2efdb22c7463c304.jpg?s=120&d=mm&r=g)
On 2008-12-31 05:08, benjamin.peterson wrote:
Author: benjamin.peterson Date: Wed Dec 31 05:08:55 2008 New Revision: 68092
Log: fix name collision issues
Modified: python/trunk/Lib/ssl.py
Modified: python/trunk/Lib/ssl.py ============================================================================== --- python/trunk/Lib/ssl.py (original) +++ python/trunk/Lib/ssl.py Wed Dec 31 05:08:55 2008 @@ -74,7 +74,7 @@ SSL_ERROR_EOF, \ SSL_ERROR_INVALID_ERROR_CODE
-from socket import socket, _fileobject +from socket import socket, _fileobject, error as socket_error from socket import getnameinfo as _getnameinfo
I'd suggest you remove all these direct imports and replace them with a single "import socket" and proper references to the module attribute where needed. It's probably also better to replace the variable name "socket" with something different. Otherwise, we'll end up reintroducing such naming collisions.
import base64 # for DER-to-PEM translation
@@ -103,7 +103,7 @@ # see if it's connected try: socket.getpeername(self) - except socket.error: + except socket_error: # no, no connection yet self._sslobj = None else: @@ -441,7 +441,7 @@ PROTOCOL_SSLv23, None) try: sock.getpeername() - except socket.error: + except socket_error: # no, no connection yet pass else: _______________________________________________ Python-checkins mailing list Python-checkins@python.org http://mail.python.org/mailman/listinfo/python-checkins
-- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 01 2009)
Python/Zope Consulting and Support ... http://www.egenix.com/ mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/
![](https://secure.gravatar.com/avatar/cd2e442c42c95ed534e4197df4300222.jpg?s=120&d=mm&r=g)
On Thu, Jan 1, 2009 at 3:29 PM, M.-A. Lemburg <mal@egenix.com> wrote:
I'd suggest you remove all these direct imports and replace them with a single "import socket" and proper references to the module attribute where needed.
It's probably also better to replace the variable name "socket" with something different. Otherwise, we'll end up reintroducing such naming collisions.
That's a good idea. It's not my library, so I didn't want to be too invasive. You should probably write a tracker ticket and assign it to Bill. -- Regards, Benjamin Peterson
participants (3)
-
Benjamin Peterson
-
benjamin.peterson
-
M.-A. Lemburg