Skip to content
Browse files

Fix #21 - exit() doesn't

  • Loading branch information...
1 parent 5b7940d commit f3b64f8475557dcf32c943789f66551d7d5b34be @google-feinberg google-feinberg committed Dec 15, 2011
Showing with 15 additions and 15 deletions.
  1. +11 −10 runtime/src/jycessing/PAppletJythonDriver.java
  2. +4 −5 testing/tests/test/jycessing/JycessingTests.java
View
21 runtime/src/jycessing/PAppletJythonDriver.java
@@ -15,16 +15,6 @@
*/
package jycessing;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.io.File;
-import java.lang.Thread.UncaughtExceptionHandler;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.HashSet;
-import java.util.concurrent.CountDownLatch;
-import java.util.regex.Pattern;
-
import org.python.core.CompileMode;
import org.python.core.CompilerFlags;
import org.python.core.Py;
@@ -41,6 +31,16 @@
import processing.core.PConstants;
import processing.core.PImage;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.io.File;
+import java.lang.Thread.UncaughtExceptionHandler;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.HashSet;
+import java.util.concurrent.CountDownLatch;
+import java.util.regex.Pattern;
+
/**
*
* @author Jonathan Feinberg <jdf@pobox.com>
@@ -114,6 +114,7 @@ public PAppletJythonDriver(final InteractiveConsole interp,
@Override
public PyObject __call__(final PyObject[] args, final String[] kws) {
finishedLatch.countDown();
+ PAppletJythonDriver.super.exit();
return Py.None;
}
});
View
9 testing/tests/test/jycessing/JycessingTests.java
@@ -2,13 +2,13 @@
import static junit.framework.Assert.assertEquals;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
+import org.junit.Test;
+import org.junit.runner.JUnitCore;
import jycessing.Runner;
-import org.junit.Test;
-import org.junit.runner.JUnitCore;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
public class JycessingTests {
@@ -19,7 +19,6 @@ private static String run(final String testResource) throws Exception {
System.setOut(new PrintStream(baos, true));
Runner.main(new String[] { "testing/test_resources/test_"
+ testResource + ".py" });
- Thread.sleep(500);
return new String(baos.toByteArray()).replaceAll("\r\n", "\n")
.replaceAll("\r", "\n");
} finally {

0 comments on commit f3b64f8

Please sign in to comment.
Something went wrong with that request. Please try again.