mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +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:
|
||||
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
|
||||
self.fp = fopen(<char*>bytes_loc, mode)
|
||||
if self.fp == NULL:
|
||||
|
|
Loading…
Reference in New Issue
Block a user