Implement suggestions by HPK

This commit is contained in:
Jason R. Coombs 2013-10-10 17:39:37 -04:00
parent a4c17dfb19
commit ee5b836e27
1 changed files with 3 additions and 2 deletions

View File

@ -173,10 +173,11 @@ class AssertionRewritingHook(object):
@classmethod
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:
pkg_resources = __import__('pkg_resources')
import pkg_resources
# access an attribute in case a deferred importer is present
pkg_resources.__name__
except ImportError: