Ezio Melotti <[email protected]> added the comment:
This is the stripid implementation:
_re_stripid = re.compile(r' at 0x[0-9a-f]{6,16}(>+)$', re.IGNORECASE)
def stripid(text):
"""Remove the hexadecimal id from a Python object representation."""
# The behaviour of %p is implementation-dependent in terms of case.
if _re_stripid.search(repr(Exception)):
return _re_stripid.sub(r'\1', text)
return text
The problem is that repr(Exception) used to return <class exceptions.Exception
at 0x00A64510> on Py<=2.4 but now returns <type 'exceptions.Exception'>, so the
code inside the if is never executed (this is what happens where there are no
unittests).
That 'if' has been introduced in r19750 and I think that the reason is to check
if the id in 'text' is really an id and hence has the same format of the ids of
other objects. I don't think this is really necessary though.
----------
assignee: -> ezio.melotti
nosy: +ezio.melotti
priority: -> normal
stage: -> test needed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue7930>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com