Fix invalid assumption NSS initialization check in SSLTransport

There code assumes that the `conn` in any Connection in the context is
a ServerProxy. This might not always be the case: ldap2 uses a
python-ldap connection here.
This commit is contained in:
Petr Viktorin 2013-09-12 14:10:20 +02:00 committed by Martin Kosek
parent 62890ca69b
commit 15618beab6

View File

@ -303,7 +303,9 @@ class SSLTransport(LanguageAwareTransport):
for value in context.__dict__.values():
if not isinstance(value, Connection):
continue
if not isinstance(value.conn._ServerProxy__transport, SSLTransport):
if not isinstance(
getattr(value.conn, '_ServerProxy__transport', None),
SSLTransport):
continue
if hasattr(value.conn._ServerProxy__transport, 'dbdir') and \
value.conn._ServerProxy__transport.dbdir == dbdir: