From eb863416cde2c7b7a7ab8f70b5bac4b4fc4d8aee Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Thu, 5 Aug 2010 15:02:20 +0200 Subject: Bug #330937: Handle IOError raised by remaining calls to array.fromfile(). --- pym/portage/util/_pty.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'pym/portage/util/_pty.py') diff --git a/pym/portage/util/_pty.py b/pym/portage/util/_pty.py index 7fba0e2ba..a4910ec70 100644 --- a/pym/portage/util/_pty.py +++ b/pym/portage/util/_pty.py @@ -95,10 +95,8 @@ def _test_pty_eof(): buf = array.array('B') try: buf.fromfile(master_file, 1024) - except EOFError: - eof = True - except IOError: - # This is where data loss occurs. + # EOFError was raised in Python <2.6.6 and <2.7.1. + except (EOFError, IOError): eof = True if not buf: -- cgit v1.2.3-1-g7c22