mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-25 00:34:20 +03:00
Fix broken lambda scoping in Python 2
This commit is contained in:
parent
f1acdaab55
commit
9c9ee24411
|
@ -439,7 +439,7 @@ class Language(object):
|
|||
continue
|
||||
if not hasattr(proc, 'to_bytes'):
|
||||
continue
|
||||
serializers[i] = lambda: proc.to_bytes(vocab=False)
|
||||
serializers[i] = lambda proc=proc: proc.to_bytes(vocab=False)
|
||||
return util.to_bytes(serializers, {})
|
||||
|
||||
def from_bytes(self, bytes_data, disable=[]):
|
||||
|
@ -459,8 +459,8 @@ class Language(object):
|
|||
continue
|
||||
if not hasattr(proc, 'from_bytes'):
|
||||
continue
|
||||
deserializers[i] = lambda b: proc.from_bytes(b, vocab=False)
|
||||
util.from_bytes(bytes_data, deserializers, {})
|
||||
deserializers[i] = lambda b, proc=proc: proc.from_bytes(b, vocab=False)
|
||||
msg = util.from_bytes(bytes_data, deserializers, {})
|
||||
return self
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user