diff options
author | Andrej Shadura <andrewsh@debian.org> | 2020-04-24 07:38:00 +0200 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2020-04-24 07:38:59 +0200 |
commit | bf1c6dee98d34b7f9d68a8b4baad74309435d888 (patch) | |
tree | b40f1428dd63e8f8e28a9779d9c47fff64135696 | |
parent | 31d2130a32a2e6d2c1f3b79b416fc713340cc4ef (diff) |
Try to import an old exception namearchive/debian/2.7-2
pyasn1 0.4.6 started throwing PyAsn1UnicodeDecodeError instead of a generic PyAsn1Error
This patch needs to be dropped when pyasn1 is updated in Debian.
Gbp-Pq: Name pyasn1-compat.patch
-rw-r--r-- | ldap3/operation/search.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ldap3/operation/search.py b/ldap3/operation/search.py index b78d86d..d7cb50d 100644 --- a/ldap3/operation/search.py +++ b/ldap3/operation/search.py @@ -38,7 +38,10 @@ from ..operation.bind import referrals_to_list from ..protocol.convert import ava_to_dict, attributes_to_list, search_refs_to_list, validate_assertion_value, prepare_filter_for_sending, search_refs_to_list_fast
from ..protocol.formatters.standard import format_attribute_values
from ..utils.conv import to_unicode, to_raw
-from pyasn1.error import PyAsn1UnicodeDecodeError
+try:
+ from pyasn1.error import PyAsn1UnicodeDecodeError
+except ImportError:
+ from pyasn1.error import PyAsn1Error as PyAsn1UnicodeDecodeError
ROOT = 0
AND = 1
|