From jython-checkins at python.org Sun Apr 16 08:19:54 2017 From: jython-checkins at python.org (stefan.richthofer) Date: Sun, 16 Apr 2017 12:19:54 +0000 Subject: [Jython-checkins] =?utf-8?q?jython=3A_Merged_PR_=2369_-_Correct_w?= =?utf-8?q?hite_space_formatting_mistake?= Message-ID: <20170416121942.122642.42291.CB3EA979@psf.io> https://hg.python.org/jython/rev/d8a6f64dd104 changeset: 8073:d8a6f64dd104 user: James Mudd date: Sun Apr 16 14:19:14 2017 +0200 summary: Merged PR #69 - Correct white space formatting mistake files: src/org/python/core/ReflectedArgs.java | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/org/python/core/ReflectedArgs.java b/src/org/python/core/ReflectedArgs.java --- a/src/org/python/core/ReflectedArgs.java +++ b/src/org/python/core/ReflectedArgs.java @@ -152,7 +152,7 @@ /* Boxes argument in the varargs position if not already boxed */ private PyObject[] ensureBoxedVarargs(PyObject[] pyArgs, int n) { if (pyArgs.length == 0) { - // If there are no args return an empty list + // If there are no args return an empty list return new PyObject[]{new PyList()}; } PyObject lastArg = pyArgs[pyArgs.length - 1]; -- Repository URL: https://hg.python.org/jython From jython-checkins at python.org Sun Apr 16 09:08:17 2017 From: jython-checkins at python.org (stefan.richthofer) Date: Sun, 16 Apr 2017 13:08:17 +0000 Subject: [Jython-checkins] =?utf-8?q?jython=3A_Merged_PR_=2368_-_=232554_A?= =?utf-8?q?dd_a_test_skip_if_no_Java_compiler_is_available_=28e=2Eg_JRE?= Message-ID: <20170416130816.9902.55111.4CAF8333@psf.io> https://hg.python.org/jython/rev/fc946dea9c0f changeset: 8074:fc946dea9c0f user: James Mudd date: Sun Apr 16 15:08:06 2017 +0200 summary: Merged PR #68 - #2554 Add a test skip if no Java compiler is available (e.g JRE not JDK) files: Lib/test/test_java_integration.py | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/Lib/test/test_java_integration.py b/Lib/test/test_java_integration.py --- a/Lib/test/test_java_integration.py +++ b/Lib/test/test_java_integration.py @@ -637,6 +637,8 @@ return self._source + at unittest.skipIf(ToolProvider.getSystemJavaCompiler() is None, + "No Java compiler available. Is JAVA_HOME pointing to a JDK?") def compile_java_source(options, class_name, source): """Compiles a single java source "file" contained in the string source -- Repository URL: https://hg.python.org/jython From jython-checkins at python.org Sun Apr 30 17:17:21 2017 From: jython-checkins at python.org (jeff.allen) Date: Sun, 30 Apr 2017 21:17:21 +0000 Subject: [Jython-checkins] =?utf-8?q?jython=3A_Fix_=232313_test=5Fjython?= =?utf-8?q?=5Finitializer_fails_on_Windows=2E?= Message-ID: <20170430211721.129399.93163.CD14050F@psf.io> https://hg.python.org/jython/rev/0a00982f6ea5 changeset: 8075:0a00982f6ea5 user: James Mudd date: Sun Apr 30 20:42:08 2017 +0100 summary: Fix #2313 test_jython_initializer fails on Windows. This moves SyspathAppendingInitializer and the service definition for org.python.core.JythonInitializer into a jar which can be more easily bundled into the tests. The test is then modified to use the jar instead of using a class file outside /dist which allows the path to resolve on Windows. The jar was built using Java 7 (1.7.0_80). This also removes the need for a custom compile entry in the build script. files: Lib/test/syspath_initializer.jar | Bin Lib/test/test_jython_initializer.py | 3 +- build.xml | 10 ----- tests/data/initializer/META-INF/services/org.python.core.JythonInitializer | 1 - tests/data/initializer/SyspathAppendingInitializer.java | 18 ---------- 5 files changed, 2 insertions(+), 30 deletions(-) diff --git a/Lib/test/syspath_initializer.jar b/Lib/test/syspath_initializer.jar new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3740410030d29791e983d9b1267ef6901b7c0fe6 GIT binary patch [stripped] diff --git a/Lib/test/test_jython_initializer.py b/Lib/test/test_jython_initializer.py --- a/Lib/test/test_jython_initializer.py +++ b/Lib/test/test_jython_initializer.py @@ -10,7 +10,8 @@ def test_syspath_initializer(self): fn = test_support.findfile('check_for_initializer_in_syspath.py') - env = dict(CLASSPATH='tests/data/initializer', + jar = test_support.findfile('syspath_initializer.jar') + env = dict(CLASSPATH=jar, PATH=os.environ.get('PATH', '')) if WINDOWS: diff --git a/build.xml b/build.xml --- a/build.xml +++ b/build.xml @@ -496,16 +496,6 @@ - - - - diff --git a/tests/data/initializer/META-INF/services/org.python.core.JythonInitializer b/tests/data/initializer/META-INF/services/org.python.core.JythonInitializer deleted file mode 100644 --- a/tests/data/initializer/META-INF/services/org.python.core.JythonInitializer +++ /dev/null @@ -1,1 +0,0 @@ -SyspathAppendingInitializer diff --git a/tests/data/initializer/SyspathAppendingInitializer.java b/tests/data/initializer/SyspathAppendingInitializer.java deleted file mode 100644 --- a/tests/data/initializer/SyspathAppendingInitializer.java +++ /dev/null @@ -1,18 +0,0 @@ -import java.util.Properties; -import org.python.core.JythonInitializer; -import org.python.core.Py; -import org.python.core.PySystemState; -import org.python.core.adapter.ExtensiblePyObjectAdapter; - -public class SyspathAppendingInitializer implements JythonInitializer { - public void initialize(Properties preProperties, - Properties postProperties, - String[] argv, - ClassLoader classLoader, - ExtensiblePyObjectAdapter adapter) { - postProperties.put(PySystemState.PYTHON_CACHEDIR_SKIP, "true"); - PySystemState defaultState = - PySystemState.doInitialize(preProperties, postProperties, argv, classLoader, adapter); - defaultState.path.append(Py.newString("/from_SyspathAppendingInitializer_with_love")); - } -} -- Repository URL: https://hg.python.org/jython