Skip to content

Commit c073831

Browse files
committed
simplify test code
1 parent 0aeee9a commit c073831

File tree

1 file changed

+2
-2
lines changed
  • graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/PythonTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ public static void enterContext(String... newArgs) {
8787
PythonTests.outArray.reset();
8888
PythonTests.errArray.reset();
8989
if (context != null) {
90-
context.leave();
91-
context.close();
90+
closeContext();
9291
}
9392
context = Context.newBuilder().engine(engine).allowAllAccess(true).arguments("python", newArgs).build();
9493
context.initialize("python");
@@ -98,6 +97,7 @@ public static void enterContext(String... newArgs) {
9897
public static void closeContext() {
9998
context.leave();
10099
context.close();
100+
context = null;
101101
}
102102

103103
public static void assertBenchNoError(Path scriptName, String[] args) {

0 commit comments

Comments
 (0)