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.)
ldap/__init__.pychecks for thread support by trying to importthread:The
threadmodule was renamed to_threadin Python 3, so the import always fails.It would probably be correct to just try importing
threadingin order to check for thread support. On Python 2, importingthreadingalso importsthread, 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.)