diff options
author | Ka-Ping Yee <ping@zesty.ca> | 2001-04-13 13:57:31 (GMT) |
---|---|---|
committer | Ka-Ping Yee <ping@zesty.ca> | 2001-04-13 13:57:31 (GMT) |
commit | 9bc576b7f6fa4bbe726255666ac7e5728f1d678b (patch) | |
tree | 32855524dc155f7daeaab8279b5831e69f867294 /Lib/pydoc.py | |
parent | eca15c1fb19c94d3a424156d072266c8d327663d (diff) | |
download | cpython-9bc576b7f6fa4bbe726255666ac7e5728f1d678b.zip cpython-9bc576b7f6fa4bbe726255666ac7e5728f1d678b.tar.gz cpython-9bc576b7f6fa4bbe726255666ac7e5728f1d678b.tar.bz2 |
Use inspect.stack()[1][3] to tell if Helper.__repr__ is called interactively.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 4 |
1 files 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 '<pydoc.Helper instance at %p>' % id(self) + return '<pydoc.Helper instance>' def __call__(self, request=None): if request is not None: |