Remove use of types.StringType.

This commit is contained in:
Guido van Rossum 2007-05-27 09:20:14 +00:00
parent c5b6ab0baa
commit a01a8b65e5
1 changed files with 3 additions and 5 deletions

View File

@ -52,7 +52,7 @@ Richard Chamberlain, for the first implementation of textdoc.
# the current directory is changed with os.chdir(), an incorrect # the current directory is changed with os.chdir(), an incorrect
# path will be displayed. # 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 from repr import Repr
try: try:
from collections import deque from collections import deque
@ -234,9 +234,7 @@ class ErrorDuringImport(Exception):
self.exc, self.value, self.tb = exc_info self.exc, self.value, self.tb = exc_info
def __str__(self): def __str__(self):
exc = self.exc exc = self.exc.__name__
if type(exc) is types.ClassType:
exc = exc.__name__
return 'problem in %s - %s: %s' % (self.filename, exc, self.value) return 'problem in %s - %s: %s' % (self.filename, exc, self.value)
def importfile(path): def importfile(path):
@ -1316,7 +1314,7 @@ def pager(text):
def getpager(): def getpager():
"""Decide what method to use for paging through text.""" """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 return plainpager
if not sys.stdin.isatty() or not sys.stdout.isatty(): if not sys.stdin.isatty() or not sys.stdout.isatty():
return plainpager return plainpager