mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 02:36:32 +03:00
Fix normalize_string_keys function'
This commit is contained in:
parent
67ade63fc4
commit
99982684b0
|
@ -79,7 +79,7 @@ def is_config(python2=None, python3=None, windows=None, linux=None, osx=None):
|
||||||
def normalize_string_keys(old):
|
def normalize_string_keys(old):
|
||||||
'''Given a dictionary, make sure keys are unicode strings, not bytes.'''
|
'''Given a dictionary, make sure keys are unicode strings, not bytes.'''
|
||||||
new = {}
|
new = {}
|
||||||
for key, value in old:
|
for key, value in old.items():
|
||||||
if isinstance(key, bytes_):
|
if isinstance(key, bytes_):
|
||||||
new[key.decode('utf8')] = value
|
new[key.decode('utf8')] = value
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user