issue5230 attempted fix of pytest segfault for python3.5

This commit is contained in:
Leander Fiedler 2020-04-12 09:34:54 +02:00 committed by lfiedler
parent d60e2d3ebf
commit 6700006830

View File

@ -491,10 +491,10 @@ cdef class Writer:
cdef class Reader:
def __init__(self, object loc):
assert path.exists(loc)
assert not path.isdir(loc)
if isinstance(loc, Path):
loc = bytes(loc)
assert path.exists(loc)
assert not path.isdir(loc)
cdef bytes bytes_loc = loc.encode('utf8') if type(loc) == unicode else loc
self._fp = fopen(<char*>bytes_loc, 'rb')
if not self._fp: