diff --git a/src/tests/test_process.py b/src/tests/test_process.py index 76be96a0..7a7549ef 100644 --- a/src/tests/test_process.py +++ b/src/tests/test_process.py @@ -84,7 +84,8 @@ class TestProcessProto(unittest.TestCase): def _get_readline(cls, pfile): pfile = os.path.join(cls.home, pfile) try: - return open(pfile, 'rb').readline().strip() + with open(pfile, 'rb') as p: + return p.readline().strip() except (OSError, IOError): pass