mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #6697: Fixed instances of _PyUnicode_AsString() result not checked for NULL
This commit is contained in:
parent
1b2bd3b348
commit
e239d23e8c
13 changed files with 144 additions and 78 deletions
|
@ -8,10 +8,26 @@ cET = support.import_module('xml.etree.cElementTree')
|
|||
# cElementTree specific tests
|
||||
|
||||
def sanity():
|
||||
"""
|
||||
r"""
|
||||
Import sanity.
|
||||
|
||||
>>> from xml.etree import cElementTree
|
||||
|
||||
Issue #6697.
|
||||
|
||||
>>> e = cElementTree.Element('a')
|
||||
>>> getattr(e, '\uD800') # doctest: +ELLIPSIS
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
UnicodeEncodeError: ...
|
||||
|
||||
>>> p = cElementTree.XMLParser()
|
||||
>>> p.version.split()[0]
|
||||
'Expat'
|
||||
>>> getattr(p, '\uD800')
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
AttributeError: 'XMLParser' object has no attribute '\ud800'
|
||||
"""
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue