From 0f0ddf6ab126e8543e24d018b7863a1513648cb6 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 3 Oct 2023 08:56:04 +0300 Subject: [PATCH] Fix: E721 do not compare types, for exact checks use 'is'/'is not', for instance checks use isinstance() --- src/tablib/packages/dbfpy/header.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tablib/packages/dbfpy/header.py b/src/tablib/packages/dbfpy/header.py index ce46192c..3da49b8a 100644 --- a/src/tablib/packages/dbfpy/header.py +++ b/src/tablib/packages/dbfpy/header.py @@ -106,7 +106,7 @@ def fromStream(cls, stream): """Return header object from the stream.""" stream.seek(0) first_32 = stream.read(32) - if type(first_32) != bytes: + if not isinstance(first_32, bytes): _data = bytes(first_32, sys.getfilesystemencoding()) _data = first_32 (_cnt, _hdrLen, _recLen) = struct.unpack("