(self, newdata)
| 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.""" |
no test coverage detected