Skip to content

Commit

Permalink
ElementTree in Python 2.5 and 2.6 didn't include a register_namespace…
Browse files Browse the repository at this point in the history
… function. Including a try/catch for backward compatibility.
  • Loading branch information
bendmorris authored and etal committed Feb 15, 2013
1 parent c48e289 commit fe2170e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Bio/Phylo/NeXMLIO.py
Expand Up @@ -33,7 +33,11 @@


for prefix, uri in XML_NAMESPACES.items():
ET.register_namespace(prefix, uri)
try:
ET.register_namespace(prefix, uri)
except AttributeError:
# for portability with Python <= 2.6
ET._namespace_map[uri] = prefix


def qUri(s):
Expand Down

0 comments on commit fe2170e

Please sign in to comment.