Skip to content

Commit

Permalink
Merge pull request #159 from amirmiron/teleport-function-nonexisting-…
Browse files Browse the repository at this point in the history
…module

fixed failed function teleportation when matching module did not exist on the other side
  • Loading branch information
tomerfiliba committed Feb 25, 2015
2 parents 85d83e5 + 1839ef9 commit d85d4c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rpyc/utils/teleportation.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def _import_codetup(codetup):

def import_function(functup):
name, modname, defaults, codetup = functup
mod = __import__(modname, None, None, "*")
try:
mod = __import__(modname, None, None, "*")
except ImportError:
mod = __import__("__main__", None, None, "*")
codeobj = _import_codetup(codetup)
return FunctionType(codeobj, mod.__dict__, name, defaults)

Expand Down

0 comments on commit d85d4c5

Please sign in to comment.