diff options
author | Guido van Rossum <guido@python.org> | 2007-05-27 09:20:14 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-27 09:20:14 (GMT) |
commit | a01a8b65e555be8212691d96671fc2175705cc16 (patch) | |
tree | cde1e06cc34466f8863ebaf47f9c9a634c2107c4 /Lib/pydoc.py | |
parent | c5b6ab0baa7e6f7cee944d3db7805b37e81c1acd (diff) | |
download | cpython-a01a8b65e555be8212691d96671fc2175705cc16.zip cpython-a01a8b65e555be8212691d96671fc2175705cc16.tar.gz cpython-a01a8b65e555be8212691d96671fc2175705cc16.tar.bz2 |
Remove use of types.StringType.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 78b00e7..9747456 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -52,7 +52,7 @@ Richard Chamberlain, for the first implementation of textdoc. # the current directory is changed with os.chdir(), an incorrect # path will be displayed. -import sys, imp, os, re, types, inspect, __builtin__, pkgutil +import sys, imp, os, re, inspect, __builtin__, pkgutil from repr import Repr try: from collections import deque @@ -234,9 +234,7 @@ class ErrorDuringImport(Exception): self.exc, self.value, self.tb = exc_info def __str__(self): - exc = self.exc - if type(exc) is types.ClassType: - exc = exc.__name__ + exc = self.exc.__name__ return 'problem in %s - %s: %s' % (self.filename, exc, self.value) def importfile(path): @@ -1316,7 +1314,7 @@ def pager(text): def getpager(): """Decide what method to use for paging through text.""" - if type(sys.stdout) is not types.FileType: + if not hasattr(sys.stdout, "isatty"): return plainpager if not sys.stdin.isatty() or not sys.stdout.isatty(): return plainpager |