]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport montanaro's checkin of
authorMichael W. Hudson <mwh@python.net>
Fri, 8 Mar 2002 13:40:46 +0000 (13:40 +0000)
committerMichael W. Hudson <mwh@python.net>
Fri, 8 Mar 2002 13:40:46 +0000 (13:40 +0000)
    revision 1.58 of pydoc.py

add repr_str as alias for repr_string in both HTMLRepr and TextRepr classes
- reflects the change in type("").__name__ between 2.1 and 2.2.  The
__name__ field is used to find a method to call for particular types.

Lib/pydoc.py

index ab11d00e450eb709a32134525cf6d59e3eb13c05..a90178f08f0d503b36d4dad90feece3d26538ce9 100755 (executable)
@@ -311,6 +311,8 @@ class HTMLRepr(Repr):
                       r'<font color="#c040c0">\1</font>',
                       self.escape(testrepr))
 
+    repr_str = repr_string
+
     def repr_instance(self, x, level):
         try:
             return self.escape(cram(stripid(repr(x)), self.maxstring))
@@ -860,6 +862,8 @@ class TextRepr(Repr):
             return 'r' + testrepr[0] + test + testrepr[0]
         return testrepr
 
+    repr_str = repr_string
+
     def repr_instance(self, x, level):
         try:
             return cram(stripid(repr(x)), self.maxstring)