mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merged revisions 78209 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78209 | ezio.melotti | 2010-02-17 01:31:04 +0200 (Wed, 17 Feb 2010) | 9 lines Merged revisions 78207 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78207 | ezio.melotti | 2010-02-17 01:26:09 +0200 (Wed, 17 Feb 2010) | 1 line #7930: fix stripid ........ ................
This commit is contained in:
parent
4d0a20a893
commit
bf839b90f4
2 changed files with 14 additions and 3 deletions
|
@ -123,9 +123,7 @@ _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
|
||||
return _re_stripid.sub(r'\1', text)
|
||||
|
||||
def _is_some_method(obj):
|
||||
return inspect.ismethod(obj) or inspect.ismethoddescriptor(obj)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue