summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/jython/files')
-rw-r--r--dev-java/jython/files/2.1-assert-SimpleCompiler.py.patch11
-rw-r--r--dev-java/jython/files/2.1-assert.patch50
-rw-r--r--dev-java/jython/files/jython-2.2.1-build.patch76
-rw-r--r--dev-java/jython/files/jython-2.2.1-build.xml.patch92
-rw-r--r--dev-java/jython/files/jython-2.5.2-build.xml.patch27
-rw-r--r--dev-java/jython/files/jython-2.5.2-distutils_byte_compilation.patch85
-rw-r--r--dev-java/jython/files/jython-2.5.2-distutils_scripts_location.patch11
-rw-r--r--dev-java/jython/files/jython-2.5.2-respect_PYTHONPATH.patch15
-rw-r--r--dev-java/jython/files/jython-2.5.2-sax-parser-class-not-found.patch39
-rw-r--r--dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch94
-rw-r--r--dev-java/jython/files/jython-2.7.0-build.xml.patch11
-rw-r--r--dev-java/jython/files/jython-2.7_beta1-ant.patch28
-rw-r--r--dev-java/jython/files/jython-2.7_beta1-dont-always-recompile-classes.patch11
-rw-r--r--dev-java/jython/files/jython-2.7_beta2-maxrepeat-import.patch16
-rw-r--r--dev-java/jython/files/python-2.5.5-distutils_byte_compilation.patch37
15 files changed, 603 insertions, 0 deletions
diff --git a/dev-java/jython/files/2.1-assert-SimpleCompiler.py.patch b/dev-java/jython/files/2.1-assert-SimpleCompiler.py.patch
new file mode 100644
index 000000000000..55e154999195
--- /dev/null
+++ b/dev-java/jython/files/2.1-assert-SimpleCompiler.py.patch
@@ -0,0 +1,11 @@
+--- jython-2.1/Tools/jythonc/SimpleCompiler.py.orig 2006-09-08 13:21:29.000000000 -0600
++++ jython-2.1/Tools/jythonc/SimpleCompiler.py 2006-09-08 13:22:15.000000000 -0600
+@@ -577,7 +577,7 @@
+ args.append(message.asAny())
+
+ return jast.If(self.frame.getglobal("__debug__").nonzero(),
+- jast.InvokeStatic("Py", "assert", args))
++ jast.InvokeStatic("Py", "assert_", args))
+
+ def return_stmt(self, value=None):
+ if value is None:
diff --git a/dev-java/jython/files/2.1-assert.patch b/dev-java/jython/files/2.1-assert.patch
new file mode 100644
index 000000000000..1f06848f2328
--- /dev/null
+++ b/dev-java/jython/files/2.1-assert.patch
@@ -0,0 +1,50 @@
+--- jython-2.1/com/ziclix/python/sql/pipe/Pipe.java.orig 2006-07-29 21:31:34.000000000 +0200
++++ jython-2.1/com/ziclix/python/sql/pipe/Pipe.java 2006-07-29 21:31:41.000000000 +0200
+@@ -93,7 +93,7 @@
+ new Integer(sinkRunner.getCount()) };
+ String msg = zxJDBC.getString("inconsistentRowCount", counts);
+
+- Py.assert(Py.Zero, Py.newString(msg));
++ Py.assert_(Py.Zero, Py.newString(msg));
+ }
+
+ return Py.newInteger(sinkRunner.getCount());
+--- jython-2.1/org/python/compiler/CodeCompiler.java.orig 2006-07-29 21:28:47.000000000 +0200
++++ jython-2.1/org/python/compiler/CodeCompiler.java 2006-07-29 21:30:13.000000000 +0200
+@@ -817,14 +817,14 @@
+ node.getChild(1).visit(this);
+ if (mrefs.assert2 == 0) {
+ mrefs.assert2 = code.pool.Methodref(
+- "org/python/core/Py", "assert",
++ "org/python/core/Py", "assert_",
+ "(" + $pyObj + $pyObj + ")V");
+ }
+ code.invokestatic(mrefs.assert2);
+ } else {
+ if (mrefs.assert1 == 0) {
+ mrefs.assert1 = code.pool.Methodref(
+- "org/python/core/Py", "assert",
++ "org/python/core/Py", "assert_",
+ "(" + $pyObj + ")V");
+ }
+ code.invokestatic(mrefs.assert1);
+--- jython-2.1/org/python/core/Py.java.orig 2006-07-29 21:29:19.000000000 +0200
++++ jython-2.1/org/python/core/Py.java 2006-07-29 21:30:40.000000000 +0200
+@@ -986,14 +986,14 @@
+
+
+ /* Equivalent to Python's assert statement */
+- public static void assert(PyObject test, PyObject message) {
++ public static void assert_(PyObject test, PyObject message) {
+ if (!test.__nonzero__()) {
+ throw new PyException(Py.AssertionError, message);
+ }
+ }
+
+- public static void assert(PyObject test) {
+- assert(test, Py.None);
++ public static void assert_(PyObject test) {
++ assert_(test, Py.None);
+ }
+
+ /* Helpers to implement finally clauses */
diff --git a/dev-java/jython/files/jython-2.2.1-build.patch b/dev-java/jython/files/jython-2.2.1-build.patch
new file mode 100644
index 000000000000..29df77621303
--- /dev/null
+++ b/dev-java/jython/files/jython-2.2.1-build.patch
@@ -0,0 +1,76 @@
+--- build.xml.org 2008-02-26 22:35:07.000000000 +1300
++++ build.xml 2008-02-26 22:35:48.000000000 +1300
+@@ -373,21 +373,13 @@
+
+ <!-- create checkout directory if necessary -->
+ <target name="prepare-checkout" if="do.checkout">
+- <mkdir dir="${svn.checkout.dir}" />
++ <echo message="Removed by patch." />
+ </target>
+
+
+ <!-- checkout if so defined -->
+ <target name="checkout" depends="prepare" if="do.checkout">
+- <svn javahl="${javahl.dir}" >
+- <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/jython" revision="${svn.revision}" destPath="${svn.checkout.dir}/jython" />
+- <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/installer" revision="${svn.revision}" destPath="${svn.checkout.dir}/installer" />
+- </svn>
+-
+- <!-- checkout cpython license from the correct python maintenance branch -->
+- <svn javahl="${javahl.dir}" >
+- <checkout url="http://svn.python.org/projects/python/branches/release22-maint/" destPath="${svn.checkout.dir}/python" recurse="false" />
+- </svn>
++ <echo message="removed by patch" />
+ </target>
+
+
+@@ -551,28 +543,13 @@
+
+
+ <!-- build the .html files using the ht2html tool -->
+- <target name="doc" depends="compile" if="full-build">
+- <fail unless="ht2html.dir" message="ht2html.dir is not set" />
+- <copy todir="${dist.dir}/Doc" preservelastmodified="true">
+- <fileset dir="Doc" includes="*.ht, **/*.gif" />
+- </copy>
+- <!-- Create .html files in Doc -->
+- <apply executable="${python.exe}" dir="Doc">
+- <env key="PYTHONPATH" path="${jython.base.dir}/Misc/htgen" />
+- <arg line="${ht2html.dir}/ht2html.py" />
+- <arg line="-s JyLocalGenerator" />
+- <fileset dir="${dist.dir}/Doc">
+- <include name="*.ht" />
+- </fileset>
+- </apply>
+- <delete>
+- <fileset dir="${dist.dir}/Doc" includes="*.ht" />
+- </delete>
++ <target name="doc" depends="compile">
++ <echo message="Functionality removed by gentoo patch" />
+ </target>
+
+
+ <!-- javadoc -->
+- <target name="javadoc" depends="compile" if="full-build">
++ <target name="javadoc" depends="compile">
+ <javadoc sourcepath="${source.dir}"
+ destdir="${apidoc.dir}"
+ source="${jdk.source.version}"
+@@ -588,7 +565,7 @@
+
+
+ <!-- copy for full distribution -->
+- <target name="copy-full" if="full-build">
++ <target name="copy-full">
+ <!-- Misc files -->
+ <echo>copy misc files from ${jython.base.dir}</echo>
+ <copy todir="${dist.dir}" preservelastmodified="true">
+@@ -599,7 +576,7 @@
+
+ <!-- copy the CPython license -->
+ <echo>copy CPython LICENSE from ${svn.checkout.dir}/python</echo>
+- <copy file="${svn.checkout.dir}/python/LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
++ <copy file="${python.lib}/../LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
+
+ <!-- sources: todir has to correspond with installer/**/JarInstaller.java -->
+ <echo>copy sources from ${jython.base.dir}</echo>
diff --git a/dev-java/jython/files/jython-2.2.1-build.xml.patch b/dev-java/jython/files/jython-2.2.1-build.xml.patch
new file mode 100644
index 000000000000..8ea197476074
--- /dev/null
+++ b/dev-java/jython/files/jython-2.2.1-build.xml.patch
@@ -0,0 +1,92 @@
+--- build.xml.orig 2012-09-27 16:13:40.750930136 +0200
++++ build.xml 2012-09-27 16:16:31.725093475 +0200
+@@ -373,21 +373,13 @@
+
+ <!-- create checkout directory if necessary -->
+ <target name="prepare-checkout" if="do.checkout">
+- <mkdir dir="${svn.checkout.dir}" />
++ <echo message="Removed by patch." />
+ </target>
+
+
+ <!-- checkout if so defined -->
+ <target name="checkout" depends="prepare" if="do.checkout">
+- <svn javahl="${javahl.dir}" >
+- <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/jython" revision="${svn.revision}" destPath="${svn.checkout.dir}/jython" />
+- <checkout url="https://jython.svn.sourceforge.net/svnroot/jython/${svn.main.dir}/installer" revision="${svn.revision}" destPath="${svn.checkout.dir}/installer" />
+- </svn>
+-
+- <!-- checkout cpython license from the correct python maintenance branch -->
+- <svn javahl="${javahl.dir}" >
+- <checkout url="http://svn.python.org/projects/python/branches/release22-maint/" destPath="${svn.checkout.dir}/python" recurse="false" />
+- </svn>
++ <echo message="removed by patch" />
+ </target>
+
+
+@@ -488,6 +480,7 @@
+ />
+
+ <!-- java files used by tests -->
++<!--
+ <javac srcdir="${jython.base.dir}/Lib/test/"
+ includes="javatests/**"
+ destdir="${output.dir}/"
+@@ -498,6 +491,7 @@
+ deprecation="${deprecation}"
+ nowarn="${nowarn}"
+ />
++-->
+
+ <copy file="${source.dir}/org/python/modules/ucnhash.dat"
+ todir="${output.dir}/org/python/modules"
+@@ -551,28 +545,13 @@
+
+
+ <!-- build the .html files using the ht2html tool -->
+- <target name="doc" depends="compile" if="full-build">
+- <fail unless="ht2html.dir" message="ht2html.dir is not set" />
+- <copy todir="${dist.dir}/Doc" preservelastmodified="true">
+- <fileset dir="Doc" includes="*.ht, **/*.gif" />
+- </copy>
+- <!-- Create .html files in Doc -->
+- <apply executable="${python.exe}" dir="Doc">
+- <env key="PYTHONPATH" path="${jython.base.dir}/Misc/htgen" />
+- <arg line="${ht2html.dir}/ht2html.py" />
+- <arg line="-s JyLocalGenerator" />
+- <fileset dir="${dist.dir}/Doc">
+- <include name="*.ht" />
+- </fileset>
+- </apply>
+- <delete>
+- <fileset dir="${dist.dir}/Doc" includes="*.ht" />
+- </delete>
++ <target name="doc" depends="compile">
++ <echo message="Functionality removed by gentoo patch" />
+ </target>
+
+
+ <!-- javadoc -->
+- <target name="javadoc" depends="compile" if="full-build">
++ <target name="javadoc" depends="compile">
+ <javadoc sourcepath="${source.dir}"
+ destdir="${apidoc.dir}"
+ source="${jdk.source.version}"
+@@ -588,7 +567,7 @@
+
+
+ <!-- copy for full distribution -->
+- <target name="copy-full" if="full-build">
++ <target name="copy-full">
+ <!-- Misc files -->
+ <echo>copy misc files from ${jython.base.dir}</echo>
+ <copy todir="${dist.dir}" preservelastmodified="true">
+@@ -599,7 +578,7 @@
+
+ <!-- copy the CPython license -->
+ <echo>copy CPython LICENSE from ${svn.checkout.dir}/python</echo>
+- <copy file="${svn.checkout.dir}/python/LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
++ <copy file="${python.lib}/../LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
+
+ <!-- sources: todir has to correspond with installer/**/JarInstaller.java -->
+ <echo>copy sources from ${jython.base.dir}</echo>
diff --git a/dev-java/jython/files/jython-2.5.2-build.xml.patch b/dev-java/jython/files/jython-2.5.2-build.xml.patch
new file mode 100644
index 000000000000..fb5e46e569ff
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-build.xml.patch
@@ -0,0 +1,27 @@
+--- build.xml.orig 2012-07-13 14:06:40.965992853 +0200
++++ build.xml 2012-07-13 14:07:29.595035840 +0200
+@@ -512,6 +512,7 @@
+ </javac>
+
+ <!-- java files used by tests -->
++<!--
+ <javac srcdir="${test.source.dir}"
+ destdir="${compile.dir}"
+ target="${jdk.target.version}"
+@@ -535,6 +536,7 @@
+ <copy file="${source.dir}/org/python/modules/ucnhash.dat"
+ todir="${compile.dir}/org/python/modules"
+ preservelastmodified="true" />
++-->
+
+ <copy todir="${compile.dir}" preservelastmodified="true">
+ <fileset dir="${source.dir}">
+@@ -758,7 +762,7 @@
+ <jycompile srcdir="${dist.dir}/Lib" destdir="${dist.dir}/Lib" excludes="test/**"/>
+ </target>
+
+- <target name="copy-lib" depends="init, copy-javalib, copy-cpythonlib">
++ <target name="copy-lib" depends="init">
+ <!-- XXX untested and most likely broken in 2.5
+ <copy todir="${dist.dir}" preservelastmodified="true">
+ <fileset dir="${jython.base.dir}" includes="Tools/**/*.py" />
diff --git a/dev-java/jython/files/jython-2.5.2-distutils_byte_compilation.patch b/dev-java/jython/files/jython-2.5.2-distutils_byte_compilation.patch
new file mode 100644
index 000000000000..db90e834f46c
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-distutils_byte_compilation.patch
@@ -0,0 +1,85 @@
+--- Lib/distutils/tests/test_build_py.py
++++ Lib/distutils/tests/test_build_py.py
+@@ -92,6 +92,25 @@
+ os.chdir(cwd)
+ sys.stdout = sys.__stdout__
+
++ def test_dont_write_bytecode(self):
++ # makes sure byte_compile is not used
++ pkg_dir, dist = self.create_dist()
++ cmd = build_py(dist)
++ cmd.compile = 1
++ cmd.optimize = 1
++
++ old_dont_write_bytecode = os.environ.get("PYTHONDONTWRITEBYTECODE")
++ os.environ["PYTHONDONTWRITEBYTECODE"] = "1"
++ try:
++ cmd.byte_compile([])
++ finally:
++ if old_dont_write_bytecode is None:
++ del os.environ["PYTHONDONTWRITEBYTECODE"]
++ else:
++ os.environ["PYTHONDONTWRITEBYTECODE"] = old_dont_write_bytecode
++
++ self.assertTrue('byte-compiling is disabled' in self.logs[0][1])
++
+ def test_suite():
+ return unittest.makeSuite(BuildPyTestCase)
+
+--- Lib/distutils/util.py
++++ Lib/distutils/util.py
+@@ -11,6 +11,7 @@
+ from distutils.dep_util import newer
+ from distutils.spawn import spawn
+ from distutils import log
++from distutils.errors import DistutilsByteCompileError
+
+ def get_platform ():
+ """Return a string that identifies the current platform. This is used
+@@ -397,6 +398,9 @@
+ generated in indirect mode; unless you know what you're doing, leave
+ it set to None.
+ """
++ # nothing is done if PYTHONDONTWRITEBYTECODE environment variable is set
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ raise DistutilsByteCompileError('byte-compiling is disabled.')
+
+ # First, if the caller didn't force us into direct or indirect mode,
+ # figure out which mode we should be in. We take a conservative
+--- Lib/distutils/command/build_py.py
++++ Lib/distutils/command/build_py.py
+@@ -418,6 +418,10 @@
+
+
+ def byte_compile (self, files):
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ self.warn('byte-compiling is disabled, skipping.')
++ return
++
+ from distutils.util import byte_compile
+ prefix = self.build_lib
+ if prefix[-1] != os.sep:
+--- Lib/distutils/command/install_lib.py
++++ Lib/distutils/command/install_lib.py
+@@ -121,6 +121,10 @@
+ return outfiles
+
+ def byte_compile (self, files):
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ self.warn('byte-compiling is disabled, skipping.')
++ return
++
+ from distutils.util import byte_compile
+
+ # Get the "--root" directory supplied to the "install" command,
+--- Lib/distutils/errors.py
++++ Lib/distutils/errors.py
+@@ -76,6 +76,8 @@
+ class DistutilsTemplateError (DistutilsError):
+ """Syntax error in a file list template."""
+
++class DistutilsByteCompileError(DistutilsError):
++ """Byte compile error."""
+
+ # Exception classes used by the CCompiler implementation classes
+ class CCompilerError (Exception):
diff --git a/dev-java/jython/files/jython-2.5.2-distutils_scripts_location.patch b/dev-java/jython/files/jython-2.5.2-distutils_scripts_location.patch
new file mode 100644
index 000000000000..150d463f1db1
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-distutils_scripts_location.patch
@@ -0,0 +1,11 @@
+--- Lib/distutils/command/install.py
++++ Lib/distutils/command/install.py
+@@ -70,7 +70,7 @@
+ 'purelib': '$base/Lib/site-packages',
+ 'platlib': '$base/Lib/site-packages',
+ 'headers': '$base/Include/$dist_name',
+- 'scripts': '$base/bin',
++ 'scripts': '/usr/bin',
+ 'data' : '$base',
+ }
+ }
diff --git a/dev-java/jython/files/jython-2.5.2-respect_PYTHONPATH.patch b/dev-java/jython/files/jython-2.5.2-respect_PYTHONPATH.patch
new file mode 100644
index 000000000000..8d028d01b567
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-respect_PYTHONPATH.patch
@@ -0,0 +1,15 @@
+--- src/org/python/core/PySystemState.java
++++ src/org/python/core/PySystemState.java
+@@ -646,6 +646,12 @@
+ if (jythonpath != null) {
+ registry.setProperty("python.path", jythonpath);
+ }
++ else {
++ jythonpath = System.getenv("PYTHONPATH");
++ if (jythonpath != null) {
++ registry.setProperty("python.path", jythonpath);
++ }
++ }
+ } catch (SecurityException e) {
+ }
+ registry.putAll(postProperties);
diff --git a/dev-java/jython/files/jython-2.5.2-sax-parser-class-not-found.patch b/dev-java/jython/files/jython-2.5.2-sax-parser-class-not-found.patch
new file mode 100644
index 000000000000..7e9273c68cb4
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-sax-parser-class-not-found.patch
@@ -0,0 +1,39 @@
+# HG changeset patch
+# User Alan Kennedy <alan@xhaus.com>
+# Date 1333300584 -3600
+# Node ID a972112ac1b155ef41b3f8ce195251bc6cc3ebce
+# Parent 920a60f5d5b5fdf46f4f26c75cab42e2a671be2f
+#1537: Fix for classloading issues with MATLAB/OpenJDK
+
+diff --git a/Lib/xml/parsers/expat.py b/Lib/xml/parsers/expat.py
+--- a/Lib/xml/parsers/expat.py
++++ b/Lib/xml/parsers/expat.py
+@@ -47,12 +47,8 @@ from org.xml.sax.helpers import XMLReade
+ from org.xml.sax.ext import DefaultHandler2
+
+ # Xerces
+-try:
+- # Name mangled by jarjar?
+- import org.python.apache.xerces.parsers.SAXParser
+- _xerces_parser = "org.python.apache.xerces.parsers.SAXParser"
+-except ImportError:
+- _xerces_parser = "org.apache.xerces.parsers.SAXParser"
++_mangled_xerces_parser_name = "org.python.apache.xerces.parsers.SAXParser"
++_xerces_parser_name = "org.apache.xerces.parsers.SAXParser"
+
+
+ # @expat args registry
+@@ -88,7 +84,11 @@ class XMLParser(object):
+ "not %s" % type(namespace_separator).__name__)
+ raise TypeError(error)
+
+- self._reader = XMLReaderFactory.createXMLReader(_xerces_parser)
++ # See http://bugs.jython.org/issue1537
++ try:
++ self._reader = XMLReaderFactory.createXMLReader(_mangled_xerces_parser_name)
++ except:
++ self._reader = XMLReaderFactory.createXMLReader(_xerces_parser_name)
+
+ if self.namespace_separator is None:
+ try:
+
diff --git a/dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch b/dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch
new file mode 100644
index 000000000000..99abc2d7864b
--- /dev/null
+++ b/dev-java/jython/files/jython-2.5.2-sax-parser-fix.patch
@@ -0,0 +1,94 @@
+
+# HG changeset patch
+# User Alan Kennedy <jython-dev@xhaus.com>
+# Date 1319980040 0
+# Node ID 936bd1b132eb9c591cf915b060c6567ae8e16914
+# Parent 71b3f883f6c5f0f39f0ae8aff097a439d4970f46
+Fix for xml attribute namespaces issue
+http://bugs.jython.org/issue1768
+
+diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
+--- a/Lib/test/test_sax.py
++++ b/Lib/test/test_sax.py
+@@ -390,22 +390,23 @@ def test_expat_nsattrs_wattr():
+ gather = AttrGatherer()
+ parser.setContentHandler(gather)
+
+- parser.parse(StringIO("<doc xmlns:ns='%s' ns:attr='val'/>" % ns_uri))
++ a_name = "id" ; a_val = "val"
++ parser.parse(StringIO("<doc xmlns:ns='%s' ns:%s='%s'/>" % (ns_uri, a_name, a_val) ))
+
+ attrs = gather._attrs
+
+ return attrs.getLength() == 1 and \
+- attrs.getNames() == [(ns_uri, "attr")] and \
+- attrs.getQNames() == ["ns:attr"] and \
++ attrs.getNames() == [(ns_uri, a_name)] and \
++ attrs.getQNames() == ["ns:%s" % a_name] and \
+ len(attrs) == 1 and \
+- attrs.has_key((ns_uri, "attr")) and \
+- attrs.keys() == [(ns_uri, "attr")] and \
+- attrs.get((ns_uri, "attr")) == "val" and \
+- attrs.get((ns_uri, "attr"), 25) == "val" and \
+- attrs.items() == [((ns_uri, "attr"), "val")] and \
+- attrs.values() == ["val"] and \
+- attrs.getValue((ns_uri, "attr")) == "val" and \
+- attrs[(ns_uri, "attr")] == "val"
++ attrs.has_key((ns_uri, a_name)) and \
++ attrs.keys() == [(ns_uri, a_name)] and \
++ attrs.get((ns_uri, a_name)) == a_val and \
++ attrs.get((ns_uri, a_name), 25) == a_val and \
++ attrs.items() == [((ns_uri, a_name), a_val)] and \
++ attrs.values() == [a_val] and \
++ attrs.getValue((ns_uri, a_name)) == a_val and \
++ attrs[(ns_uri, a_name)] == a_val
+
+ def test_expat_nsattrs_no_namespace():
+ parser = make_parser()
+@@ -413,22 +414,23 @@ def test_expat_nsattrs_no_namespace():
+ gather = AttrGatherer()
+ parser.setContentHandler(gather)
+
+- parser.parse(StringIO("<doc attr='val'/>"))
++ a_name = "id" ; a_val = "val"
++ parser.parse(StringIO("<doc %s='%s'/>" % (a_name, a_val) ))
+
+ attrs = gather._attrs
+
+ return attrs.getLength() == 1 and \
+- attrs.getNames() == [(None, "attr")] and \
+- attrs.getQNames() == ["attr"] and \
++ attrs.getNames() == [(None, a_name)] and \
++ attrs.getQNames() == [a_name] and \
+ len(attrs) == 1 and \
+- attrs.has_key((None, "attr")) and \
+- attrs.keys() == [(None, "attr")] and \
+- attrs.get((None, "attr")) == "val" and \
+- attrs.get((None, "attr"), 25) == "val" and \
+- attrs.items() == [((None, "attr"), "val")] and \
+- attrs.values() == ["val"] and \
+- attrs.getValue((None, "attr")) == "val" and \
+- attrs[(None, "attr")] == "val"
++ attrs.has_key((None, a_name)) and \
++ attrs.keys() == [(None, a_name)] and \
++ attrs.get((None, a_name)) == a_val and \
++ attrs.get((None, a_name), 25) == a_val and \
++ attrs.items() == [((None, a_name), a_val)] and \
++ attrs.values() == [a_val] and \
++ attrs.getValue((None, a_name)) == a_val and \
++ attrs[(None, a_name)] == a_val
+
+ # ===== InputSource support
+
+diff --git a/Lib/xml/sax/drivers2/drv_javasax.py b/Lib/xml/sax/drivers2/drv_javasax.py
+--- a/Lib/xml/sax/drivers2/drv_javasax.py
++++ b/Lib/xml/sax/drivers2/drv_javasax.py
+@@ -238,7 +238,7 @@ class JavaSAXParser(xmlreader.XMLReader,
+ pass # TODO
+
+ def _fixTuple(nsTuple, frm, to):
+- if len(nsTuple) == 2:
++ if isinstance(nsTuple, tuple) and len(nsTuple) == 2:
+ nsUri, localName = nsTuple
+ if nsUri == frm:
+ nsUri = to
diff --git a/dev-java/jython/files/jython-2.7.0-build.xml.patch b/dev-java/jython/files/jython-2.7.0-build.xml.patch
new file mode 100644
index 000000000000..4e27af771eb4
--- /dev/null
+++ b/dev-java/jython/files/jython-2.7.0-build.xml.patch
@@ -0,0 +1,11 @@
+--- build.xml.orig 2015-06-27 16:12:08.442000000 +0000
++++ build.xml 2015-06-27 16:12:15.684000000 +0000
+@@ -448,7 +448,7 @@
+ </target>
+
+ <target name="antlr_gen" depends="prepare-output" unless="antlr.notneeded">
+- <java classname="org.antlr.Tool" failonerror="true" fork="true" dir="${jython.base.dir}">
++ <java classname="org.antlr.Tool" failonerror="false" fork="true" dir="${jython.base.dir}">
+ <jvmarg value="-Xmx512m"/>
+ <arg value="-Xconversiontimeout"/>
+ <arg value="2000"/>
diff --git a/dev-java/jython/files/jython-2.7_beta1-ant.patch b/dev-java/jython/files/jython-2.7_beta1-ant.patch
new file mode 100644
index 000000000000..c86cae894a92
--- /dev/null
+++ b/dev-java/jython/files/jython-2.7_beta1-ant.patch
@@ -0,0 +1,28 @@
+--- jython-2.7-b1-sources/build.xml
++++ jython-2.7-b1-sources/build.xml
+@@ -508,6 +509,7 @@
+ </javac>
+
+ <!-- java files used by tests -->
++<!--
+ <javac srcdir="${test.source.dir}"
+ destdir="${compile.dir}"
+ target="${jdk.target.version}"
+@@ -529,6 +531,7 @@
+ <compilerarg line="${javac.Xlint}"/>
+ <classpath refid="test.classpath" />
+ </javac>
++-->
+ <copy file="${source.dir}/org/python/modules/ucnhash.dat"
+ todir="${compile.dir}/org/python/modules"
+ preservelastmodified="true" />
+@@ -826,9 +829,6 @@
+
+ <target name="copy-javalib" unless="full-build">
+ <copy todir="${dist.dir}/javalib">
+- <fileset dir="${jython.base.dir}/extlibs">
+- <exclude name="profile.properties"/>
+- </fileset>
+ <fileset dir="${work.dir}/build">
+ <include name="*.jar"/>
+ <include name="*.properties"/>
diff --git a/dev-java/jython/files/jython-2.7_beta1-dont-always-recompile-classes.patch b/dev-java/jython/files/jython-2.7_beta1-dont-always-recompile-classes.patch
new file mode 100644
index 000000000000..326ef7f62afa
--- /dev/null
+++ b/dev-java/jython/files/jython-2.7_beta1-dont-always-recompile-classes.patch
@@ -0,0 +1,11 @@
+--- a/src/org/python/core/imp.java
++++ b/src/org/python/core/imp.java
+@@ -228,7 +228,7 @@
+ }
+ if (testing && mtime != NO_MTIME) {
+ long time = ar.getMTime();
+- if (mtime != time) {
++ if (mtime < time) {
+ return null;
+ }
+ }
diff --git a/dev-java/jython/files/jython-2.7_beta2-maxrepeat-import.patch b/dev-java/jython/files/jython-2.7_beta2-maxrepeat-import.patch
new file mode 100644
index 000000000000..944bb195cb38
--- /dev/null
+++ b/dev-java/jython/files/jython-2.7_beta2-maxrepeat-import.patch
@@ -0,0 +1,16 @@
+diff -r 035eded55c4d lib-python/2.7/sre_constants.py
+--- a/lib-python/2.7/sre_constants.py Wed Apr 16 18:30:13 2014 -0600
++++ b/lib-python/2.7/sre_constants.py Fri Jul 25 10:31:27 2014 -0700
+@@ -15,7 +15,11 @@
+
+ MAGIC = 20031017
+
+-from _sre import MAXREPEAT
++try:
++ from _sre import MAXREPEAT
++except ImportError:
++ import _sre
++ MAXREPEAT = _sre.MAXREPEAT = 65535
+
+ # SRE standard exception (access as sre.error)
+ # should this really be here?
diff --git a/dev-java/jython/files/python-2.5.5-distutils_byte_compilation.patch b/dev-java/jython/files/python-2.5.5-distutils_byte_compilation.patch
new file mode 100644
index 000000000000..d029247dd256
--- /dev/null
+++ b/dev-java/jython/files/python-2.5.5-distutils_byte_compilation.patch
@@ -0,0 +1,37 @@
+--- Lib/distutils/command/build_py.py
++++ Lib/distutils/command/build_py.py
+@@ -418,6 +418,10 @@
+
+
+ def byte_compile (self, files):
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ self.warn('byte-compiling is disabled, skipping.')
++ return
++
+ from distutils.util import byte_compile
+ prefix = self.build_lib
+ if prefix[-1] != os.sep:
+--- Lib/distutils/command/install_lib.py
++++ Lib/distutils/command/install_lib.py
+@@ -121,6 +121,10 @@
+ return outfiles
+
+ def byte_compile (self, files):
++ if os.environ.get("PYTHONDONTWRITEBYTECODE") is not None:
++ self.warn('byte-compiling is disabled, skipping.')
++ return
++
+ from distutils.util import byte_compile
+
+ # Get the "--root" directory supplied to the "install" command,
+--- Lib/distutils/errors.py
++++ Lib/distutils/errors.py
+@@ -76,6 +76,8 @@
+ class DistutilsTemplateError (DistutilsError):
+ """Syntax error in a file list template."""
+
++class DistutilsByteCompileError(DistutilsError):
++ """Byte compile error."""
+
+ # Exception classes used by the CCompiler implementation classes
+ class CCompilerError (Exception):