]> granicus.if.org Git - python/commitdiff
use isinstance
authorBenjamin Peterson <benjamin@python.org>
Wed, 23 Jul 2008 13:25:06 +0000 (13:25 +0000)
committerBenjamin Peterson <benjamin@python.org>
Wed, 23 Jul 2008 13:25:06 +0000 (13:25 +0000)
Lib/imghdr.py

index 2fbc9661eb91aea93760826e325aeba2ee8e36e7..233ea33f2c552b9196e454a1cc60999041a4b78e 100644 (file)
@@ -8,7 +8,7 @@ __all__ = ["what"]
 
 def what(file, h=None):
     if h is None:
-        if type(file) == type(''):
+        if isinstance(file, basestring):
             f = open(file, 'rb')
             h = f.read(32)
         else: