Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ElementTree in Python 2.5 and 2.6 didn't include a register_namespace…

… function. Including a try/catch for backward compatibility.
  • Loading branch information...
commit fe2170e7f95558c6c172f7b78c4f0fedd8eae89b 1 parent c48e289
@bendmorris bendmorris authored etal committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 Bio/Phylo/NeXMLIO.py
View
6 Bio/Phylo/NeXMLIO.py
@@ -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):
Please sign in to comment.
Something went wrong with that request. Please try again.