Implement suggestions by HPK
This commit is contained in:
parent
a4c17dfb19
commit
ee5b836e27
|
@ -173,10 +173,11 @@ class AssertionRewritingHook(object):
|
||||||
@classmethod
|
@classmethod
|
||||||
def _register_with_pkg_resources(cls):
|
def _register_with_pkg_resources(cls):
|
||||||
"""
|
"""
|
||||||
Ensure package resources can be loaded from this loader.
|
Ensure package resources can be loaded from this loader. May be called
|
||||||
|
multiple times, as the operation is idempotent.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
pkg_resources = __import__('pkg_resources')
|
import pkg_resources
|
||||||
# access an attribute in case a deferred importer is present
|
# access an attribute in case a deferred importer is present
|
||||||
pkg_resources.__name__
|
pkg_resources.__name__
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
Loading…
Reference in New Issue