diff options
Diffstat (limited to 'qpid/python')
| -rw-r--r-- | qpid/python/mllib/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/qpid/python/mllib/__init__.py b/qpid/python/mllib/__init__.py index 81165f6999..39e9363614 100644 --- a/qpid/python/mllib/__init__.py +++ b/qpid/python/mllib/__init__.py @@ -22,7 +22,7 @@ This module provides document parsing and transformation utilities for both SGML and XML. """ -import os, dom, transforms, parsers +import os, dom, transforms, parsers, sys import xml.sax, types from cStringIO import StringIO @@ -50,8 +50,11 @@ def sgml_parse(source): return p.parser.tree def xml_parse(filename): - # XXX: this is for older versions of python - source = "file://%s" % os.path.abspath(filename) + if sys.version_info[0:2] == (2,3): + # XXX: this is for older versions of python + source = "file://%s" % os.path.abspath(filename) + else: + source = filename p = parsers.XMLParser() xml.sax.parse(source, p) return p.parser.tree |
