Commits

Anonymous committed 25f55b2

Use inspect.stack()[1][3] to tell if Helper.__repr__ is called interactively.

Comments (0)

Files changed (1)

                 self.docdir = dir
 
     def __repr__(self):
-        if len(inspect.stack()) <= 2:
+        if inspect.stack()[1][3] == '?':
             self()
             return ''
-        return '<pydoc.Helper instance at %p>' % id(self)
+        return '<pydoc.Helper instance>'
 
     def __call__(self, request=None):
         if request is not None: