summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorAidan Skinner <aidan@apache.org>2008-05-14 14:47:31 +0000
committerAidan Skinner <aidan@apache.org>2008-05-14 14:47:31 +0000
commit9cc70bbe0ed008653b050fe2e2fec0a90aa8ad1f (patch)
tree83dab8e28344a7594077bc763dc2f2f9f74fd31e /qpid/python
parent992188d7eca74f295bec51a33512428abeb39089 (diff)
downloadqpid-python-9cc70bbe0ed008653b050fe2e2fec0a90aa8ad1f.tar.gz
Merge branch 'python-mllib'
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@656301 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/mllib/__init__.py9
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