mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 01:48:04 +03:00 
			
		
		
		
	* Fix python3 error
This commit is contained in:
		
							parent
							
								
									99387f9572
								
							
						
					
					
						commit
						dbda6c27fa
					
				| 
						 | 
					@ -6,7 +6,7 @@ cdef class CFile:
 | 
				
			||||||
        if isinstance(mode, unicode):
 | 
					        if isinstance(mode, unicode):
 | 
				
			||||||
            mode_str = mode.encode('ascii')
 | 
					            mode_str = mode.encode('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_str)
 | 
				
			||||||
        if self.fp == NULL:
 | 
					        if self.fp == NULL:
 | 
				
			||||||
            raise IOError("Could not open binary file %s" % bytes_loc)
 | 
					            raise IOError("Could not open binary file %s" % bytes_loc)
 | 
				
			||||||
        self.is_open = True
 | 
					        self.is_open = True
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user