diff options
| author | Aidan Skinner <aidan@apache.org> | 2008-05-14 14:47:31 +0000 |
|---|---|---|
| committer | Aidan Skinner <aidan@apache.org> | 2008-05-14 14:47:31 +0000 |
| commit | 0a554501a3cce16c56fb11f7e9b53d9720fecb92 (patch) | |
| tree | c7919de41947bee2ad9e44b51a04e7bdf803a8c7 | |
| parent | ab44ec2945063878517ffa70222d219f0d8766b5 (diff) | |
| download | qpid-python-0a554501a3cce16c56fb11f7e9b53d9720fecb92.tar.gz | |
Merge branch 'python-mllib'
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@656301 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | python/mllib/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/mllib/__init__.py b/python/mllib/__init__.py index 81165f6999..39e9363614 100644 --- a/python/mllib/__init__.py +++ b/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 |
