From 9bc576b7f6fa4bbe726255666ac7e5728f1d678b Mon Sep 17 00:00:00 2001 From: Ka-Ping Yee Date: Fri, 13 Apr 2001 13:57:31 +0000 Subject: Use inspect.stack()[1][3] to tell if Helper.__repr__ is called interactively. --- Lib/pydoc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 5f37225..ee9177d 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: -- cgit v0.12