Skip to content
Snippets Groups Projects
Commit 25e3c6da authored by Craig Tiller's avatar Craig Tiller
Browse files

Fix EINTR forever

parent c2d9f1e2
No related branches found
No related tags found
No related merge requests found
......@@ -192,18 +192,21 @@ class Benchmark:
return [self.final[f] if f in self.final else '' for f in flds]
def read_file(filename):
def eintr_be_gone(fn):
"""Run fn until it doesn't stop because of EINTR"""
while True:
try:
with open(filename) as f:
return f.read()
return fn()
except IOError, e:
if e.errno != errno.EINTR:
raise
def read_json(filename):
return json.loads(read_file(filename))
with open(filename) as f: return json.loads(f.read())
def finalize():
benchmarks = collections.defaultdict(Benchmark)
for bm in args.benchmarks:
......@@ -241,3 +244,7 @@ else:
text = 'No significant performance differences'
comment_on_pr.comment_on_pr('```\n%s\n```' % text)
print text
eintr_be_gone(finalize)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment