Skip to content

Commit 7f3f38f

Browse files
committed
update and inline comment
1 parent c2eca70 commit 7f3f38f

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

glue/main.py

+2-14
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,9 @@ def load_plugins(splash=None, require_qt_plugins=False, plugins_to_load=None):
7070
if not config.plugins[item.name]:
7171
continue
7272

73-
# We don't use item.load() because that then checks requirements of all
74-
# the imported packages, which can lead to errors like this one that
75-
# don't really matter:
76-
#
77-
# Exception: (pytest 2.6.0 (/Users/tom/miniconda3/envs/py27/lib/python2.7/site-packages),
78-
# Requirement.parse('pytest>=2.8'), set(['astropy']))
79-
#
80-
# Just to be clear, this kind of error does indicate that there is an
81-
# old version of a package in the environment, but this can confuse
82-
# users as importing astropy directly would work (as setuptools then
83-
# doesn't do a stringent test of dependency versions). Often this kind
84-
# of error can occur if there is a conda version of a package and an
85-
# older pip version.
86-
8773
try:
74+
# item.load() (importlib.metadata.EntryPoint.load) doesn't *always*
75+
# return a module, so, using import_module is safer here.
8876
module = import_module(item.module)
8977
function = getattr(module, item.attr)
9078
function()

0 commit comments

Comments
 (0)