Commit 9e32999
committed
compatible with python-2.6
Fixes two issues in generators/xml.py when using python-2.6.
The main problem is caused by incompatible between xml.etree.ElementTree-1.2
(used by pyhton-2.6) and xml.etree.ElementTree-1.3 (used by python-2.7).
+ ElementTree.register_namespace(prefix, uri)
Workaround by:
ElementTree._namespace_map[uri] = prefix
This solution is based on http://goo.gl/Z4Sjtq
+ ElementTree.write(file, encoding='utf-8', xml_declaration=True)
Workaround by:
ElementTree.write(file, encoding='UTF-8')
This solution is based on http://goo.gl/8K88ow (pls check Olli's answer)
Also replaces unittest by unittest2 which is compitable with python-2.6.
Signed-off-by: Kai Zhang <zhangk1985@gmail.com>1 parent f4da1a2 commit 9e32999
3 files changed
+14
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| |||
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
113 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
0 commit comments