Kaydet (Commit) 9bc576b7 authored tarafından Ka-Ping Yee's avatar Ka-Ping Yee

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

üst eca15c1f
......@@ -1268,10 +1268,10 @@ class Helper:
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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment