提交 7d63eaef authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Fixed some lines longer than 80 characters

上级 ddf1c0e6
...@@ -671,18 +671,20 @@ class ModuleCache(object): ...@@ -671,18 +671,20 @@ class ModuleCache(object):
if not key_broken: if not key_broken:
try: try:
kd_from_file = cPickle.load(open(key_pkl, 'rb')) kd2 = cPickle.load(open(key_pkl, 'rb'))
assert len(kd_from_file.keys) == 1 assert len(kd2.keys) == 1
key_from_file = kd_from_file.keys.__iter__().next() key_from_file = kd2.keys.__iter__().next()
if key != key_from_file: if key != key_from_file:
raise Exception( raise Exception(
"key not equal to unpickled version (Hint:" "Key not equal to unpickled version "
" verify the __eq__ and __hash__ functions" "(Hint: verify the __eq__ and "
" for your Ops", (key, key_from_file)) "__hash__ functions for your Ops",
(key, key_from_file))
# Adding the key file to this set means it is a # Adding the key file to this set means it is a
# versioned key. # versioned key.
self.loaded_key_pkl.add(key_pkl) self.loaded_key_pkl.add(key_pkl)
self.module_hash_to_key_data[module_hash] = key_data self.module_hash_to_key_data[module_hash] = \
key_data
except cPickle.UnpicklingError: except cPickle.UnpicklingError:
warning('Cache failure due to un-loadable key', warning('Cache failure due to un-loadable key',
key) key)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论