mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-07-31 23:08:09 -07:00
dev-java/jython: Remove vulnerable versions. Fixes security bug 552452.
Package-Manager: portage-2.2.26 Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
--- 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:
|
||||
@@ -1,50 +0,0 @@
|
||||
--- 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 */
|
||||
@@ -1,76 +0,0 @@
|
||||
--- 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>
|
||||
@@ -1,92 +0,0 @@
|
||||
--- 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>
|
||||
@@ -1,27 +0,0 @@
|
||||
--- 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" />
|
||||
@@ -1,85 +0,0 @@
|
||||
--- 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):
|
||||
@@ -1,39 +0,0 @@
|
||||
# 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:
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
|
||||
# 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
|
||||
@@ -1,37 +0,0 @@
|
||||
--- 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):
|
||||
Reference in New Issue
Block a user