Updated _get_readline function file open by with block

Reverted skip_python3 function remove change
This commit is contained in:
kuldeep.k@cisinlabs.com 2021-08-12 17:34:15 +05:30
parent 6dffb1e470
commit e79a0e21e9
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A

View File

@ -87,7 +87,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