Skip to content

Commit

Permalink
Replace rebuild_module with __import__
Browse files Browse the repository at this point in the history
  • Loading branch information
sklam committed Apr 16, 2021
1 parent 033452b commit e13d80c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions numba/core/environment.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import weakref

from numba import _dynfunc
from numba.core import serialize


class Environment(_dynfunc.Environment):
Expand Down Expand Up @@ -48,7 +48,8 @@ def _rebuild_env(modname, consts, env_name):
if env is not None:
return env

mod = serialize._rebuild_module(modname)
__import__(modname)
mod = sys.modules[modname]
env = Environment(mod.__dict__)
env.consts[:] = consts
env.env_name = env_name
Expand Down

0 comments on commit e13d80c

Please sign in to comment.