[Python-checkins] python/dist/src/Lib pydoc.py,1.86.8.1,1.86.8.2

bcannon at users.sourceforge.net bcannon at users.sourceforge.net
Fri Jun 18 21:05:42 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9973/Lib

Modified Files:
      Tag: release23-maint
	pydoc.py 
Log Message:
pydoc.stripid() is now case-insensitive.

Closes bug #934282.  Thanks Robin Becker.


Index: pydoc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v
retrieving revision 1.86.8.1
retrieving revision 1.86.8.2
diff -C2 -d -r1.86.8.1 -r1.86.8.2
*** pydoc.py	31 Oct 2003 13:05:04 -0000	1.86.8.1
--- pydoc.py	19 Jun 2004 01:05:39 -0000	1.86.8.2
***************
*** 105,114 ****
      return text
  
  def stripid(text):
      """Remove the hexadecimal id from a Python object representation."""
!     # The behaviour of %p is implementation-dependent; we check two cases.
!     for pattern in [' at 0x[0-9a-f]{6,}(>+)$', ' at [0-9A-F]{8,}(>+)$']:
!         if re.search(pattern, repr(Exception)):
!             return re.sub(pattern, '\\1', text)
      return text
  
--- 105,114 ----
      return text
  
+ _re_stripid = re.compile(r' at 0x[0-9a-f]{6,}(>+)$', 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
  




More information about the Python-checkins mailing list