Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Commit

Permalink
Merge pull request #96 from JPFrancoia/compat
Browse files Browse the repository at this point in the history
Python 3.5 compatibility. Fixes #94.
  • Loading branch information
timeyyy committed Nov 3, 2015
2 parents 33586a0 + 7a9ce9b commit f2ef69a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions esky/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,10 @@ def compile_to_bytecode(source_code, compile_filename=None):
elif sys.version_info[:2] < (3, 4):
bytecode = imp.get_magic() + struct.pack("<ii", 0, 0)
bytecode += marshal.dumps(compile(source_code, compile_filename, "exec"))
if sys.version_info[:2] >= (3, 5):
loader = importlib._bootstrap_external.SourceLoader()
code = loader.source_to_code(source_code, '<string>')
bytecode = importlib._bootstrap_external._code_to_bytecode(code, mtime=0, source_size=0)
else:
loader = importlib._bootstrap.SourceLoader()
code = loader.source_to_code(source_code, '<string>')
Expand Down

0 comments on commit f2ef69a

Please sign in to comment.