Use pkgutil in case of any error with pkg_resources (PY-29671)

Problems with `pkg_resources` module shouldn't break working with extensions in debugger.
This commit is contained in:
Elizaveta Shashkova
2018-04-25 14:10:44 +03:00
parent 50f04e43e2
commit 3601a8a83c
6 changed files with 5 additions and 7 deletions
@@ -1,11 +1,9 @@
import pkgutil
import sys
import traceback
from _pydev_bundle import pydev_log
try:
import pydevd_plugins.extensions as extensions
except:
traceback.print_exc()
extensions = None
@@ -1,5 +1,5 @@
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
except:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
@@ -1,5 +1,5 @@
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
except:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
@@ -1,5 +1,5 @@
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
except:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
@@ -1,5 +1,5 @@
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
except:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
@@ -1,5 +1,5 @@
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
except:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)