summaryrefslogtreecommitdiffstats
path: root/pym/portage
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2010-08-05 15:02:20 +0200
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2010-08-05 15:02:20 +0200
commiteb863416cde2c7b7a7ab8f70b5bac4b4fc4d8aee (patch)
tree8d7819f2133cbc68f701c7deec9a00ed1cca35f7 /pym/portage
parent293bd0e85326a22effb5f10d1489014ecc617e59 (diff)
downloadportage-eb863416cde2c7b7a7ab8f70b5bac4b4fc4d8aee.tar.gz
portage-eb863416cde2c7b7a7ab8f70b5bac4b4fc4d8aee.tar.bz2
portage-eb863416cde2c7b7a7ab8f70b5bac4b4fc4d8aee.zip
Bug #330937: Handle IOError raised by remaining calls to array.fromfile().
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/package/ebuild/doebuild.py3
-rw-r--r--pym/portage/tests/ebuild/test_array_fromfile_eof.py3
-rw-r--r--pym/portage/util/_pty.py6
3 files changed, 6 insertions, 6 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index b9cbc3e0e..c8ec3fc23 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1268,7 +1268,8 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
buf = array.array('B')
try:
buf.fromfile(f, buffsize)
- except EOFError:
+ # EOFError was raised in Python <2.6.6 and <2.7.1.
+ except (EOFError, IOError):
pass
if not buf:
eof = True
diff --git a/pym/portage/tests/ebuild/test_array_fromfile_eof.py b/pym/portage/tests/ebuild/test_array_fromfile_eof.py
index 3f2a6c7c5..c32a15cb0 100644
--- a/pym/portage/tests/ebuild/test_array_fromfile_eof.py
+++ b/pym/portage/tests/ebuild/test_array_fromfile_eof.py
@@ -28,7 +28,8 @@ class ArrayFromfileEofTestCase(TestCase):
a = array.array('B')
try:
a.fromfile(f, len(input_bytes) + 1)
- except EOFError:
+ # EOFError was raised in Python <2.6.6 and <2.7.1.
+ except (EOFError, IOError):
# python-3.0 lost data here
eof = True
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: