fix race condition as reported by Ralf Schmitt

This commit is contained in:
holger krekel
2011-04-14 21:35:27 +02:00
parent bd30e96ab0
commit d9c5f18478
3 changed files with 24 additions and 6 deletions

View File

@@ -201,14 +201,11 @@ class StatRecorder:
newstat = {}
for rootdir in self.rootdirlist:
for path in rootdir.visit(self.fil, self.rec):
oldstat = statcache.get(path, None)
if oldstat is not None:
del statcache[path]
oldstat = statcache.pop(path, None)
try:
newstat[path] = curstat = path.stat()
except py.error.ENOENT:
if oldstat:
del statcache[path]
changed = True
else:
if oldstat: