Skip to content
This repository
Browse code

Fix #21 - exit() doesn't

  • Loading branch information...
commit f3b64f8475557dcf32c943789f66551d7d5b34be 1 parent 5b7940d
google-feinberg google-feinberg authored
21 runtime/src/jycessing/PAppletJythonDriver.java
@@ -15,16 +15,6 @@
15 15 */
16 16 package jycessing;
17 17
18   -import java.awt.event.ComponentAdapter;
19   -import java.awt.event.ComponentEvent;
20   -import java.io.File;
21   -import java.lang.Thread.UncaughtExceptionHandler;
22   -import java.lang.reflect.Field;
23   -import java.lang.reflect.Modifier;
24   -import java.util.HashSet;
25   -import java.util.concurrent.CountDownLatch;
26   -import java.util.regex.Pattern;
27   -
28 18 import org.python.core.CompileMode;
29 19 import org.python.core.CompilerFlags;
30 20 import org.python.core.Py;
@@ -41,6 +31,16 @@
41 31 import processing.core.PConstants;
42 32 import processing.core.PImage;
43 33
  34 +import java.awt.event.ComponentAdapter;
  35 +import java.awt.event.ComponentEvent;
  36 +import java.io.File;
  37 +import java.lang.Thread.UncaughtExceptionHandler;
  38 +import java.lang.reflect.Field;
  39 +import java.lang.reflect.Modifier;
  40 +import java.util.HashSet;
  41 +import java.util.concurrent.CountDownLatch;
  42 +import java.util.regex.Pattern;
  43 +
44 44 /**
45 45 *
46 46 * @author Jonathan Feinberg <jdf@pobox.com>
@@ -114,6 +114,7 @@ public PAppletJythonDriver(final InteractiveConsole interp,
114 114 @Override
115 115 public PyObject __call__(final PyObject[] args, final String[] kws) {
116 116 finishedLatch.countDown();
  117 + PAppletJythonDriver.super.exit();
117 118 return Py.None;
118 119 }
119 120 });
9 testing/tests/test/jycessing/JycessingTests.java
@@ -2,13 +2,13 @@
2 2
3 3 import static junit.framework.Assert.assertEquals;
4 4
5   -import java.io.ByteArrayOutputStream;
6   -import java.io.PrintStream;
  5 +import org.junit.Test;
  6 +import org.junit.runner.JUnitCore;
7 7
8 8 import jycessing.Runner;
9 9
10   -import org.junit.Test;
11   -import org.junit.runner.JUnitCore;
  10 +import java.io.ByteArrayOutputStream;
  11 +import java.io.PrintStream;
12 12
13 13 public class JycessingTests {
14 14
@@ -19,7 +19,6 @@ private static String run(final String testResource) throws Exception {
19 19 System.setOut(new PrintStream(baos, true));
20 20 Runner.main(new String[] { "testing/test_resources/test_"
21 21 + testResource + ".py" });
22   - Thread.sleep(500);
23 22 return new String(baos.toByteArray()).replaceAll("\r\n", "\n")
24 23 .replaceAll("\r", "\n");
25 24 } finally {

0 comments on commit f3b64f8

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