From 42491fc043584f96f811d8761b14436e6fc85f71 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Fri, 25 Aug 2006 01:52:49 +0000 Subject: importing types is not necessary if we use isinstance --- Lib/encodings/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py index ff05fb75f9..82e517a774 100644 --- a/Lib/encodings/__init__.py +++ b/Lib/encodings/__init__.py @@ -28,7 +28,7 @@ Written by Marc-Andre Lemburg (mal@lemburg.com). """#" -import codecs, types +import codecs from encodings import aliases _cache = {} @@ -60,7 +60,7 @@ def normalize_encoding(encoding): """ # Make sure we have an 8-bit string, because .translate() works # differently for Unicode strings. - if type(encoding) is types.UnicodeType: + if isinstance(encoding, unicode): # Note that .encode('latin-1') does *not* use the codec # registry, so this call doesn't recurse. (See unicodeobject.c # PyUnicode_AsEncodedString() for details) -- cgit v1.2.1