Neal Norwitz wrote: > http://python.org/sf/1513611 > xml.sax.ParseException weirdness in python 2.5b1. The following code > doesn't work: > > from xml.sax import make_parser, SAXParseException > > parser = make_parser() > try: > parser.parse(StringIO('invalid')) > except SAXParseException: > print 'caught it!' > > Any comments?
The problem can be simplified to this: py> import xml.sax,xmlcore.sax,sys py> sys.modules['xml.sax'] is sys.modules['xmlcore.sax'] False One way to fix this would be to never refer to "xmlcore" explicitly (i.e. import from xml.sax._exceptions in expatreader), but I guess that would defeat the purpose of the xmlcore renaming. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com