| 
62 | 62 | from binascii import crc32  | 
63 | 63 | 
 
  | 
64 | 64 | from gitdb.const import NULL_BYTE  | 
65 |  | -from gitdb.utils.compat import (  | 
66 |  | -    buffer,   | 
67 |  | -    to_bytes  | 
68 |  | -)  | 
 | 65 | +from gitdb.utils.compat import to_bytes  | 
69 | 66 | 
 
  | 
70 | 67 | import tempfile  | 
71 | 68 | import array  | 
@@ -117,7 +114,7 @@ def pack_object_at(cursor, offset, as_stream):  | 
117 | 114 |     # END handle type id  | 
118 | 115 |     abs_data_offset = offset + total_rela_offset  | 
119 | 116 |     if as_stream:  | 
120 |  | -        stream = DecompressMemMapReader(buffer(data, total_rela_offset), False, uncomp_size)  | 
 | 117 | +        stream = DecompressMemMapReader(data[total_rela_offset:], False, uncomp_size)  | 
121 | 118 |         if delta_info is None:  | 
122 | 119 |             return abs_data_offset, OPackStream(offset, type_id, uncomp_size, stream)  | 
123 | 120 |         else:  | 
@@ -408,7 +405,7 @@ def offsets(self):  | 
408 | 405 |         if self._version == 2:  | 
409 | 406 |             # read stream to array, convert to tuple  | 
410 | 407 |             a = array.array('I')    # 4 byte unsigned int, long are 8 byte on 64 bit it appears  | 
411 |  | -            a.frombytes(buffer(self._cursor.map(), self._pack_offset, self._pack_64_offset - self._pack_offset))  | 
 | 408 | +            a.frombytes(self._cursor.map()[self._pack_offset:self._pack_64_offset])  | 
412 | 409 | 
 
  | 
413 | 410 |             # networkbyteorder to something array likes more  | 
414 | 411 |             if sys.byteorder == 'little':  | 
@@ -836,7 +833,7 @@ def is_valid_stream(self, sha, use_crc=False):  | 
836 | 833 |             while cur_pos < next_offset:  | 
837 | 834 |                 rbound = min(cur_pos + chunk_size, next_offset)  | 
838 | 835 |                 size = rbound - cur_pos  | 
839 |  | -                this_crc_value = crc_update(buffer(pack_data, cur_pos, size), this_crc_value)  | 
 | 836 | +                this_crc_value = crc_update(pack_data[cur_pos:cur_pos + size], this_crc_value)  | 
840 | 837 |                 cur_pos += size  | 
841 | 838 |             # END window size loop  | 
842 | 839 | 
 
  | 
 | 
0 commit comments