Skip to content

Instantly share code, notes, and snippets.

@sklam
Created June 17, 2019 16:12
Show Gist options
  • Save sklam/c78bfcd90f54d14dc96e539e3276a62d to your computer and use it in GitHub Desktop.
Save sklam/c78bfcd90f54d14dc96e539e3276a62d to your computer and use it in GitHub Desktop.
diff --git a/numba/funcdesc.py b/numba/funcdesc.py
index 740e43e93..77b583543 100644
--- a/numba/funcdesc.py
+++ b/numba/funcdesc.py
@@ -145,7 +145,7 @@ class FunctionDescriptor(object):
kws = () # TODO
global_dict = None
- if modname is None:
+ if modname is None or modname not in sys.modules:
# Dynamically generated function.
modname = _dynamic_modname
# Retain a reference to the dictionary of the function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment