Add pyldap_version constant to allow ID of ldap implementation.
Bug Description: Pyldap changes *just* enough to break compatability between
python ldap, and pyldap.
Fix Description: To allow users to detect what behaviour they need to use,
they can look for the "well known" flag ldap.PYLDAP_VERSION. If it doesn't
exist, then we it can be determined we are on python-ldap.
The following pattern can be used:
if hasattr(ldap, 'PYLDAP_VERSION'):
# Do pyldap behaviour
else:
# Do python-ldap behaviour
This commit is contained in:
@@ -22,6 +22,8 @@ if __debug__:
|
|||||||
import _ldap
|
import _ldap
|
||||||
from _ldap import *
|
from _ldap import *
|
||||||
|
|
||||||
|
PYLDAP_VERSION = __version__
|
||||||
|
|
||||||
OPT_NAMES_DICT = {}
|
OPT_NAMES_DICT = {}
|
||||||
for k,v in vars(_ldap).items():
|
for k,v in vars(_ldap).items():
|
||||||
if k.startswith('OPT_'):
|
if k.startswith('OPT_'):
|
||||||
|
|||||||
Reference in New Issue
Block a user