File tree Expand file tree Collapse file tree
packages/google-crc32c/src/google_crc32c Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 from google_crc32c import cext as impl
2626
2727 implementation = "c"
28- except ImportError as exc :
28+ except ImportError :
2929 from google_crc32c import python as impl # type: ignore
3030
3131 warnings .warn (_SLOW_CRC32C_WARNING , RuntimeWarning )
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- import struct
16-
1715# NOTE: ``__config__`` **must** be the first import because it (may)
1816# modify the search path used to locate shared libraries.
19- import google_crc32c .__config__ # type: ignore
17+ import google_crc32c .__config__ # noqa: F401
2018from google_crc32c ._checksum import CommonChecksum
2119from google_crc32c ._crc32c import extend # type: ignore
2220from google_crc32c ._crc32c import value # type: ignore
Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515import array
16- import struct
1716
1817from google_crc32c ._checksum import CommonChecksum
1918
@@ -71,7 +70,7 @@ def update(self, data):
7170 chunk (Optional[bytes]): a chunk of data used to extend
7271 the CRC32C checksum.
7372 """
74- if type (data ) != array .array or data .itemsize != 1 :
73+ if not isinstance (data , array .array ) or data .itemsize != 1 :
7574 buffer = array .array ("B" , data )
7675 else :
7776 buffer = data
You can’t perform that action at this time.
0 commit comments