summaryrefslogtreecommitdiff
path: root/debian/patches/pyasn1-compat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/pyasn1-compat.patch')
-rw-r--r--debian/patches/pyasn1-compat.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/patches/pyasn1-compat.patch b/debian/patches/pyasn1-compat.patch
new file mode 100644
index 0000000..9b38abd
--- /dev/null
+++ b/debian/patches/pyasn1-compat.patch
@@ -0,0 +1,27 @@
+From: Andrej Shadura <andrewsh@debian.org>
+Date: Fri, 24 Apr 2020 07:38:00 +0200
+Subject: Try to import an old exception name
+
+pyasn1 0.4.6 started throwing PyAsn1UnicodeDecodeError instead of a generic PyAsn1Error
+
+This patch needs to be dropped when pyasn1 is updated in Debian.
+---
+ ldap3/operation/search.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+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