Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1639505c
Commit
1639505c
authored
Feb 16, 2012
by
Florent Xicluna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the _namespace_map cleanup for cElementTree tests.
parent
e59a3060
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
Lib/test/test_xml_etree.py
Lib/test/test_xml_etree.py
+1
-6
Lib/xml/etree/ElementTree.py
Lib/xml/etree/ElementTree.py
+2
-0
No files found.
Lib/test/test_xml_etree.py
View file @
1639505c
...
...
@@ -1881,12 +1881,7 @@ class CleanContext(object):
def
__enter__
(
self
):
from
xml.etree
import
ElementPath
if
hasattr
(
ET
,
'_namespace_map'
):
self
.
_nsmap
=
ET
.
_namespace_map
else
:
# when testing the cElementTree alias
from
xml.etree.ElementTree
import
_namespace_map
self
.
_nsmap
=
_namespace_map
self
.
_nsmap
=
ET
.
register_namespace
.
_namespace_map
# Copy the default namespace mapping
self
.
_nsmap_copy
=
self
.
_nsmap
.
copy
()
# Copy the path cache (should be empty)
...
...
Lib/xml/etree/ElementTree.py
View file @
1639505c
...
...
@@ -1086,6 +1086,8 @@ _namespace_map = {
# dublin core
"http://purl.org/dc/elements/1.1/"
:
"dc"
,
}
# For tests and troubleshooting
register_namespace
.
_namespace_map
=
_namespace_map
def
_raise_serialization_error
(
text
):
raise
TypeError
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment