Two asserts changed program state, and so problems could occur if
the asserts are not executed (such as when PYTHONOPTIMIZE is fiddled
with). Move the side-effect code out of the assert and test only
previously calculated results.
if not self.p or self.p.poll() != None:
self._restart()
assert(self.p)
- assert(self.p.poll() == None)
+ r = self.p.poll()
+ assert(r == None)
if self.inprogress:
log('_fast_get: opening %r while %r is open\n'
% (id, self.inprogress))
yield type
for blob in it:
yield blob
- assert(self.p.stdout.readline() == '\n')
+ l = self.p.stdout.readline()
+ assert(l == '\n')
self.inprogress = None
except Exception, e:
it.abort()