From 73d857750a0e310d17011e5ee116221241d1f498 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sun, 3 Sep 2017 22:04:24 -0700 Subject: [PATCH] Add check for EINTR during example testing; this should help avoid sporadic test failures on travis --- examples/utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/utils.py b/examples/utils.py index cbdf69c6..88adc9c9 100644 --- a/examples/utils.py +++ b/examples/utils.py @@ -3,6 +3,7 @@ import subprocess import time import os import sys +import errno from pyqtgraph.pgcollections import OrderedDict from pyqtgraph.python2_3 import basestring @@ -143,7 +144,14 @@ except: output = '' fail = False while True: - c = process.stdout.read(1).decode() + try: + c = process.stdout.read(1).decode() + except IOError as err: + if err.errno == errno.EINTR: + # Interrupted system call; just try again. + c = '' + else: + raise output += c #sys.stdout.write(c) #sys.stdout.flush()