diff --git a/Lib/imghdr.py b/Lib/imghdr.py index 2fbc9661eb9..233ea33f2c5 100644 --- a/Lib/imghdr.py +++ b/Lib/imghdr.py @@ -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: