Skip to content

Commit aaf831d

Browse files
committed
Fix setting locals in PyEval_EvalCodeEx
1 parent 92430b3 commit aaf831d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4460,8 +4460,10 @@ static Object doGeneric(VirtualFrame frame, Object codeWrapper, Object globalsWr
44604460
Object[] pArguments = createAndCheckArgumentsNode.execute(code, userArguments, keywords, signature, null, defaults, kwdefaults, false);
44614461

44624462
// set custom locals
4463-
PArguments.setSpecialArgument(pArguments, locals);
4464-
PArguments.setCustomLocals(pArguments, locals);
4463+
if (!(locals instanceof PNone)) {
4464+
PArguments.setSpecialArgument(pArguments, locals);
4465+
PArguments.setCustomLocals(pArguments, locals);
4466+
}
44654467
PArguments.setClosure(pArguments, closure);
44664468
// TODO(fa): set builtins in globals
44674469
// PythonModule builtins = getContext().getBuiltins();

0 commit comments

Comments
 (0)