-
Notifications
You must be signed in to change notification settings - Fork 127
Closed
Description
ldap/__init__.py
checks for thread support by trying to import thread
:
try:
# Check if Python installation was build with thread support
import thread
except ImportError:
LDAPLockBaseClass = DummyLock
else:
import threading
LDAPLockBaseClass = threading.Lock
The thread
module was renamed to _thread
in Python 3, so the import always fails.
It would probably be correct to just try importing threading
in order to check for thread support. On Python 2, importing threading
also imports thread
, so there's no difference: https://github.com/python/cpython/blob/2.7/Lib/threading.py
(As an aside, Python 3.7 dropped support for builds without threads: https://bugs.python.org/issue31370.)
Metadata
Metadata
Assignees
Labels
No labels