From: Ka-Ping Yee Date: Fri, 13 Apr 2001 13:57:31 +0000 (+0000) Subject: Use inspect.stack()[1][3] to tell if Helper.__repr__ is called interactively. X-Git-Tag: v2.1c1~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9bc576b7f6fa4bbe726255666ac7e5728f1d678b;p=thirdparty%2FPython%2Fcpython.git Use inspect.stack()[1][3] to tell if Helper.__repr__ is called interactively. --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 5f372258c123..ee9177d7e151 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -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 '' % id(self) + return '' def __call__(self, request=None): if request is not None: