Skip to content

Commit

Permalink
fix bug in python2 implementation of extension module import mechanism
Browse files Browse the repository at this point in the history
(cherry picked from commit 0c92f83)
  • Loading branch information
Alex Tremblay authored and kblomqvist committed Aug 19, 2020
1 parent 33f54dc commit fe61691
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions yasha/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ def load_python_module(file):
module = loader.load_module()
except ImportError: # Fallback to Python2
import imp
desc = (".py", "rb", imp.PY_SOURCE)
module = imp.load_module('yasha_extensions', file, file.name, desc)
with open(file.name) as f:
desc = (".py", "rb", imp.PY_SOURCE)
module = imp.load_module('yasha_extensions', f, file.name, desc)
pass
return module

def load_extensions(file):
Expand Down

0 comments on commit fe61691

Please sign in to comment.