File tree Expand file tree Collapse file tree 5 files changed +30
-11
lines changed Expand file tree Collapse file tree 5 files changed +30
-11
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ Modules/
13
13
Lib/
14
14
* ldap.__version__, ldap.__author__ and ldap.__license__ now
15
15
imported from new sub-module ldap.pkginfo also to setup.py
16
+ * Added safety assertion when importing _ldap:
17
+ ldap.pkginfo.__version__ must match _ldap.__version__
16
18
* removed stand-alone module dsml
17
19
* slapdtest.SlapdObject.restart() just restarts slapd
18
20
without cleaning any data
Original file line number Diff line number Diff line change 17
17
_trace_file = sys .stderr
18
18
_trace_stack_limit = None
19
19
20
+ from ldap .pkginfo import __version__
21
+
20
22
import _ldap
23
+ assert _ldap .__version__ == __version__ , \
24
+ ImportError ('ldap %s and _ldap %s version mismatch!' % (__version__ ,_ldap .__version__ ))
21
25
from _ldap import *
22
26
23
27
OPT_NAMES_DICT = {}
Original file line number Diff line number Diff line change 9
9
Each class provides support for a certain control.
10
10
"""
11
11
12
- from ldap import __version__
12
+ from ldap .pkginfo import __version__
13
+
14
+ import _ldap
15
+ assert _ldap .__version__ == __version__ , \
16
+ ImportError ('ldap %s and _ldap %s version mismatch!' % (__version__ ,_ldap .__version__ ))
17
+
18
+ import ldap
19
+
20
+ try :
21
+ from pyasn1 .error import PyAsn1Error
22
+ except ImportError :
23
+ PyAsn1Error = None
24
+
13
25
14
26
__all__ = [
15
27
'KNOWN_RESPONSE_CONTROLS' ,
32
44
# response control OID to class registry
33
45
KNOWN_RESPONSE_CONTROLS = {}
34
46
35
- import _ldap ,ldap
36
-
37
- try :
38
- from pyasn1 .error import PyAsn1Error
39
- except ImportError :
40
- PyAsn1Error = None
41
-
42
47
43
48
class RequestControl :
44
49
"""
Original file line number Diff line number Diff line change 6
6
See https://www.python-ldap.org/ for details.
7
7
"""
8
8
9
- import _ldap ,ldap
9
+ from ldap .pkginfo import __version__
10
+
11
+ import _ldap
12
+ assert _ldap .__version__ == __version__ , \
13
+ ImportError ('ldap %s and _ldap %s version mismatch!' % (__version__ ,_ldap .__version__ ))
14
+
15
+ import ldap
16
+
10
17
from ldap .controls import RequestControl ,LDAPControl ,KNOWN_RESPONSE_CONTROLS
11
18
12
19
Original file line number Diff line number Diff line change 7
7
- Tested with Python 2.0+
8
8
"""
9
9
10
- from ldap import __version__
11
-
10
+ from ldap .pkginfo import __version__
12
11
13
12
import _ldap
13
+ assert _ldap .__version__ == __version__ , \
14
+ ImportError ('ldap %s and _ldap %s version mismatch!' % (__version__ ,_ldap .__version__ ))
14
15
15
16
import ldap .functions
16
17
You can’t perform that action at this time.
0 commit comments