Skip to content

Commit dbfb2c2

Browse files
workaround global finder bug when nested functions and imports are in play
1 parent 2ae6b8e commit dbfb2c2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/execnet/gateway.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ def _source_of_function(function):
208208
source = textwrap.dedent(source) # just for inner functions
209209

210210
used_globals = _find_non_builtin_globals(source, codeobj)
211-
if used_globals:
211+
if used_globals and False:
212+
# disabled this check as it fails for more complex examples
212213
raise ValueError("the use of non-builtin globals isn't supported", used_globals)
213214

214215
leading_ws = "\n" * (codeobj.co_firstlineno - 1)

testing/test_basics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ def f():
405405

406406
assert self.check(f) == []
407407

408+
@pytest.mark.xfail(reason="test disabled due to bugs")
408409
def test_function_with_global_fails(self):
409410
def func(channel):
410411
sys

0 commit comments

Comments
 (0)