From e5492c7490a5bfdfee8944f04628d2d8e7ce854a Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Fri, 30 Mar 2018 06:15:03 -0700 Subject: [PATCH] Stop catching ImportError for pyasn1 pyasn1 and pyasn1_modules are hard dependencies of python-ldap. They have been listed in install_requires since commit 5d158578ce5a01f159378294ae7a88af66d4a05b. As they are not optional, can expect imports to succeed. --- Lib/ldap/controls/__init__.py | 5 +---- Lib/ldap/extop/__init__.py | 9 ++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Lib/ldap/controls/__init__.py b/Lib/ldap/controls/__init__.py index 43b938d..811b3be 100644 --- a/Lib/ldap/controls/__init__.py +++ b/Lib/ldap/controls/__init__.py @@ -17,10 +17,7 @@ import ldap -try: - from pyasn1.error import PyAsn1Error -except ImportError: - PyAsn1Error = None +from pyasn1.error import PyAsn1Error __all__ = [ diff --git a/Lib/ldap/extop/__init__.py b/Lib/ldap/extop/__init__.py index d18c682..874166d 100644 --- a/Lib/ldap/extop/__init__.py +++ b/Lib/ldap/extop/__init__.py @@ -63,10 +63,5 @@ def decodeResponseValue(self,value): return value -# Optionally import sub-modules which need pyasn1 et al -try: - import pyasn1,pyasn1_modules.rfc2251 -except ImportError: - pass -else: - from ldap.extop.dds import * +# Import sub-modules +from ldap.extop.dds import *