Skip to content

Commit

Permalink
Fix transformers plugin loading on older setuptools versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Jan 5, 2015
1 parent 9052f3a commit 772aec2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion guessit/plugins/transformers.py
Expand Up @@ -87,7 +87,10 @@ def order_extensions(self, extensions):

def _load_one_plugin(self, ep, invoke_on_load, invoke_args, invoke_kwds, verify_requirements=True):
if not ep.dist:
plugin = ep._load() # require kwarg of ep.load() is deprecated, so access this internal method.
if hasattr(ep, '_load'):
plugin = ep._load() # `require` argument of ep.load() is deprecated in newer versions of setuptools
else:
plugin = ep.load(require=False)
else:
plugin = ep.load()
if invoke_on_load:
Expand Down

0 comments on commit 772aec2

Please sign in to comment.