Commit 1f394dc7 authored by Julien Muchembled's avatar Julien Muchembled

Fix TypeError when the system lacks memory

This fixes up commit e3781aff
(Reduce probability of dying when the system lacks memory").
parent 87bc6bb9
......@@ -148,20 +148,21 @@ exit = exit()
class Popen(subprocess.Popen):
def __init__(self, *args, **kw):
try:
super(Popen, self).__init__(*args, **kw)
except OSError, e:
if e.errno != errno.ENOMEM:
raise
self.returncode = -1
try:
super(Popen, self).__init__(*args, **kw)
except OSError, e:
if e.errno != errno.ENOMEM:
raise
self.returncode = -1
def stop(self):
self.terminate()
t = threading.Timer(5, self.kill)
t.start()
r = self.wait()
t.cancel()
return r
if self.pid:
self.terminate()
t = threading.Timer(5, self.kill)
t.start()
r = self.wait()
t.cancel()
return r
def makedirs(path):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment