Upstream release 2.18, Python 3 support

This commit is contained in:
Dan Callaghan 2018-07-05 15:57:59 +10:00
commit 7f29d5c4a5
No known key found for this signature in database
GPG key ID: 7AA9FECF9C666408
7 changed files with 332 additions and 19 deletions

View file

@ -1,20 +0,0 @@
--- a/xmltramp.py 2011-01-07 15:27:58.000000000 +1000
+++ b/xmltramp.py 2011-11-02 14:03:07.881107507 +1000
@@ -224,7 +224,9 @@
attrs = dict(attrs)
newprefixes = {}
- for k in self.prefixes.keys(): newprefixes[k] = self.prefixes[k][-1]
+ for k in self.prefixes.keys():
+ if self.prefixes[k]:
+ newprefixes[k] = self.prefixes[k][-1]
self.stack.append(Element(name, attrs, prefixes=newprefixes.copy()))
@@ -357,5 +359,6 @@
assert parse('<x a="&lt;"></x>').__repr__(1) == '<x a="&lt;"></x>'
assert parse('<a xmlns="http://a"><b xmlns="http://b"/></a>').__repr__(1) == '<a xmlns="http://a"><b xmlns="http://b"></b></a>'
+ assert parse('<a><b xmlns="http://b"/><c/></a>').__repr__(1) == '<a><b xmlns="http://b"></b><c></c></a>'
if __name__ == '__main__': unittest()