Skip to content

Commit

Permalink
Fix semantics of exec_module vs create_module
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Nov 5, 2023
1 parent 546d2ee commit 02a626b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/julia/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def find_spec(self, fullname, path=None, target=None):
filepath = os.path.join(os.path.dirname(__file__), filename)
if os.path.isfile(filepath + ".py") or os.path.isdir(filepath):
return
return ModuleSpec(fullname, JuliaModuleLoader())
return ModuleSpec(fullname, JuliaModuleLoader(), origin=filepath)


class JuliaModuleLoader(Loader):
Expand All @@ -240,7 +240,10 @@ def julia(self):
return julia

def exec_module(self, module):
fullname = module.__name__
pass

def create_module(self, spec):
fullname = spec.name
juliapath = remove_prefix(fullname, "julia.")
if juliapath == 'Main':
return sys.modules.setdefault(fullname,
Expand Down

0 comments on commit 02a626b

Please sign in to comment.