[Jython-checkins] jython (2.5): #1537: Fix for classloading issues with MATLAB/OpenJDK

alan.kennedy jython-checkins at python.org
Sun Apr 1 19:33:20 CEST 2012


http://hg.python.org/jython/rev/a972112ac1b1
changeset:   6522:a972112ac1b1
branch:      2.5
parent:      6520:920a60f5d5b5
user:        Alan Kennedy <alan at xhaus.com>
date:        Sun Apr 01 18:16:24 2012 +0100
summary:
  #1537: Fix for classloading issues with MATLAB/OpenJDK

files:
  Lib/xml/parsers/expat.py |  14 +++++++-------
  1 files changed, 7 insertions(+), 7 deletions(-)


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.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 @@
                      "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:

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list