mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
* Fix typing on mode string in CFile
This commit is contained in:
parent
22028602a9
commit
b81ffe9032
|
@ -2,7 +2,9 @@ from libc.stdio cimport fopen, fclose, fread, fwrite, FILE
|
||||||
|
|
||||||
|
|
||||||
cdef class CFile:
|
cdef class CFile:
|
||||||
def __init__(self, loc, bytes mode):
|
def __init__(self, loc, mode):
|
||||||
|
if isinstance(mode, unicode):
|
||||||
|
mode_str = mode.decode('ascii')
|
||||||
cdef bytes bytes_loc = loc.encode('utf8') if type(loc) == unicode else loc
|
cdef bytes bytes_loc = loc.encode('utf8') if type(loc) == unicode else loc
|
||||||
self.fp = fopen(<char*>bytes_loc, mode)
|
self.fp = fopen(<char*>bytes_loc, mode)
|
||||||
if self.fp == NULL:
|
if self.fp == NULL:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user