提交 52a98808 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Merge pull request #2786 from nouiz/cache

Cache
...@@ -10,7 +10,7 @@ tutorials/exercises if you need to learn it or only need a refresher: ...@@ -10,7 +10,7 @@ tutorials/exercises if you need to learn it or only need a refresher:
* `Python Challenge <http://www.pythonchallenge.com/>`__ * `Python Challenge <http://www.pythonchallenge.com/>`__
* `Dive into Python <http://diveintopython.net/>`__ * `Dive into Python <http://diveintopython.net/>`__
* `Google Python Class <http://code.google.com/edu/languages/google-python-class/index.html>`__ * `Google Python Class <https://developers.google.com/edu/python/>`__
* `Enthought Python course <https://training.enthought.com/?utm_source=academic&utm_medium=email&utm_campaign=EToD-Launch#/courses>`__ (free for academics) * `Enthought Python course <https://training.enthought.com/?utm_source=academic&utm_medium=email&utm_campaign=EToD-Launch#/courses>`__ (free for academics)
We have a tutorial on how :ref:`Python manages its memory <python-memory-management>`. We have a tutorial on how :ref:`Python manages its memory <python-memory-management>`.
...@@ -1121,7 +1121,9 @@ class ModuleCache(object): ...@@ -1121,7 +1121,9 @@ class ModuleCache(object):
# same time. This can happen as we read the cache # same time. This can happen as we read the cache
# without taking the lock. # without taking the lock.
if i == 2: if i == 2:
raise with compilelock.lock_ctx():
with open(key_pkl, 'rb') as f:
key_data = cPickle.load(f)
time.sleep(2) time.sleep(2)
found = sum(key == other_key for other_key in key_data.keys) found = sum(key == other_key for other_key in key_data.keys)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论