Skip to content
Snippets Groups Projects
Unverified Commit 92da84a4 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fix

parent ea2a5439
No related branches found
No related tags found
No related merge requests found
Pipeline #60928 passed with stage
in 47 seconds
......@@ -11,10 +11,17 @@ stages:
- cd minijson
- python setup.py install
- cd ..
- rm -rf minijson
- pip install -r requirements.txt
- python setup.py build_ext --inplace
variables:
CI: "1"
script:
- python setup.py test
- python -m coverage run -m nose2 -vv -F
- python -m coverage report
test_python38:
extends: .test_python
image: python:3.8
\ No newline at end of file
image: python:3.8
......@@ -58,11 +58,10 @@ cdef class AlternativeMMap:
self.io.seek(item, 0)
b = self.io.read(1)
return b[0]
else:
start = item.start
stop = item.stop
self.io.seek(start, 0)
return self.io.read(stop-start)
start = item.start
stop = item.stop
self.io.seek(start, 0)
return self.io.read(stop-start)
def __setitem__(self, key: tp.Union[int, slice], value: tp.Union[int, bytes]) -> None:
cdef:
......@@ -228,7 +227,7 @@ cdef class Chunk:
if index > self.entries:
raise ValueError('index too large')
cdef unsigned long ofs = HEADER_SIZE + TIMESTAMP_SIZE + index * (self.block_size + TIMESTAMP_SIZE) + byte_index
return ord(self.mmap[ofs])
return self.mmap[ofs]
cpdef bytes get_slice_of_piece_starting_at(self, unsigned int index, unsigned int start):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment