Skip to content

Commit e5492c7

Browse files
committed
Stop catching ImportError for pyasn1
pyasn1 and pyasn1_modules are hard dependencies of python-ldap. They have been listed in install_requires since commit 5d15857. As they are not optional, can expect imports to succeed.
1 parent adc40d0 commit e5492c7

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

Lib/ldap/controls/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717

1818
import ldap
1919

20-
try:
21-
from pyasn1.error import PyAsn1Error
22-
except ImportError:
23-
PyAsn1Error = None
20+
from pyasn1.error import PyAsn1Error
2421

2522

2623
__all__ = [

Lib/ldap/extop/__init__.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,5 @@ def decodeResponseValue(self,value):
6363
return value
6464

6565

66-
# Optionally import sub-modules which need pyasn1 et al
67-
try:
68-
import pyasn1,pyasn1_modules.rfc2251
69-
except ImportError:
70-
pass
71-
else:
72-
from ldap.extop.dds import *
66+
# Import sub-modules
67+
from ldap.extop.dds import *

0 commit comments

Comments
 (0)