Skip to content

Commit 608e19d

Browse files
committed
regardless of unbuffered IO it is fine to re-use
1 parent 285c255 commit 608e19d

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,10 @@ protected boolean areOptionsCompatible(OptionValues firstOptions, OptionValues n
164164
}
165165

166166
private boolean areOptionsCompatibleWithPreinitializedContext(OptionValues firstOptions, OptionValues newOptions) {
167-
// Buffered IO was applied during context initialization
168167
return (areOptionsCompatible(firstOptions, newOptions) &&
169-
firstOptions.get(PythonOptions.UnbufferedIO).equals(newOptions.get(PythonOptions.UnbufferedIO)) &&
170168
// we cache WithThread in SysConfigModuleBuiltins
171169
firstOptions.get(PythonOptions.WithThread).equals(newOptions.get(PythonOptions.WithThread)) &&
172-
// disabling TRegex has an effect on the _sre Python code that is created
170+
// disabling TRegex has an effect on the _sre Python functions that are dynamically created
173171
firstOptions.get(PythonOptions.WithTRegex).equals(newOptions.get(PythonOptions.WithTRegex)));
174172
}
175173

mx.graalpython/mx_graalpython.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,6 @@ def graalpython_gate_runner(args, tasks):
414414
mx.log(launcher)
415415
mx.run([launcher, "--log.python.level=FINE", "-S", "-c", "print(b'abc'.decode('ascii'))"], out=mx.TeeOutputCapture(out), err=mx.TeeOutputCapture(out))
416416
assert "Using preinitialized context." in out.data
417-
# And test that we can start even if the graalvm was moved and we cannot use a preinitialized context
418-
# n.b.: Forcing unbuffered IO is incompatible with the preinitialized context
419-
out = mx.OutputCapture()
420-
mx.run([launcher, "--log.python.level=FINE", "-u", "-S", "-c", "print(b'abc'.decode('ascii'))"], out=mx.TeeOutputCapture(out), err=mx.TeeOutputCapture(out))
421-
assert "Using preinitialized context." not in out.data
422417

423418
with Task('GraalPython GraalVM native embedding', tasks, tags=[GraalPythonTags.svm, GraalPythonTags.graalvm, GraalPythonTags.native_image_embedder]) as task:
424419
if task:

0 commit comments

Comments
 (0)