Skip to content

Commit fd63b36

Browse files
committed
re-introduce linecache usage again
This removes the if/else case when the file_name is not present, and relies once again on linecache, fixing a problem where `source` would always be set to None in remote modules
1 parent f14ceaa commit fd63b36

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

execnet/gateway.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
(c) 2004-2013, Holger Krekel and others
55
"""
66
import inspect
7+
import linecache
78
import os
89
import sys
910
import textwrap
@@ -111,10 +112,8 @@ def remote_exec(self, source, **kwargs):
111112
file_name = None
112113
if isinstance(source, types.ModuleType):
113114
file_name = inspect.getsourcefile(source)
114-
if not file_name:
115-
source = inspect.getsource(source)
116-
else:
117-
source = None
115+
linecache.updatecache(file_name)
116+
source = inspect.getsource(source)
118117
elif isinstance(source, types.FunctionType):
119118
call_name = source.__name__
120119
file_name = inspect.getsourcefile(source)

0 commit comments

Comments
 (0)