MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _update_crc

Method _update_crc

tools/python-3.11.9-amd64/Lib/zipfile.py:975–983  ·  view source on GitHub ↗
(self, newdata)

Source from the content-addressed store, hash-verified

973 return buf
974
975 def _update_crc(self, newdata):
976 # Update the CRC using the given data.
977 if self._expected_crc is None:
978 # No need to compute the CRC if we don't have a reference value
979 return
980 self._running_crc = crc32(newdata, self._running_crc)
981 # Check the CRC if we're at the end of the file
982 if self._eof and self._running_crc != self._expected_crc:
983 raise BadZipFile("Bad CRC-32 for file %r" % self.name)
984
985 def read1(self, n):
986 """Read up to n bytes with at most one read() system call."""

Callers 1

_read1Method · 0.95

Calls 2

crc32Function · 0.85
BadZipFileClass · 0.85

Tested by

no test coverage detected