This commit is contained in:
Luke Campagnola 2016-12-14 10:14:11 -08:00
parent 8fc98a6a0b
commit 8d85b87d71

View File

@ -3,13 +3,17 @@ from pyqtgraph import Qt
from . import utils from . import utils
import itertools import itertools
import pytest import pytest
import os import os, sys
import __builtin__
# printing on travis ci frequently leads to "interrupted system call" errors. # printing on travis ci frequently leads to "interrupted system call" errors.
# as a workaround, we overwrite the built-in print function (bleh) # as a workaround, we overwrite the built-in print function (bleh)
if os.getenv('TRAVIS') is not None: if os.getenv('TRAVIS') is not None:
if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins
def flaky_print(*args): def flaky_print(*args):
"""Wrapper for print that retries in case of IOError. """Wrapper for print that retries in case of IOError.
""" """
@ -24,7 +28,7 @@ if os.getenv('TRAVIS') is not None:
raise raise
pass pass
orig_print = __builtin__.print orig_print = __builtin__.print
__builtin__.print = flaky_print builtins.print = flaky_print
print("Installed wrapper for flaky print.") print("Installed wrapper for flaky print.")