Use isinstance(x, y) instead of type(x) == y

Fixes pylint C0123.
This commit is contained in:
sedrubal
2018-10-18 17:16:42 +02:00
committed by Adrien Vergé
parent dc4a9f4fff
commit 3ef85739e3
4 changed files with 19 additions and 17 deletions

View File

@@ -226,7 +226,7 @@ def run(input, conf, filepath=None):
if conf.is_file_ignored(filepath):
return ()
if type(input) in (type(b''), type(u'')): # compat with Python 2 & 3
if isinstance(input, (type(b''), type(u''))): # compat with Python 2 & 3
return _run(input, conf, filepath)
elif hasattr(input, 'read'): # Python 2's file or Python 3's io.IOBase
# We need to have everything in memory to parse correctly