aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-01-28 11:27:47 -0800
committerZac Medico <zmedico@gentoo.org>2019-01-28 11:42:21 -0800
commitd66f4238e6b5dca2bbc0fb04f64c67f3e0bc3586 (patch)
tree1a39d72db366177f0b683682e0047bc852372cc0 /bin
parentUpdates for portage-2.3.59 release (diff)
downloadportage-d66f4238e6b5dca2bbc0fb04f64c67f3e0bc3586.tar.gz
portage-d66f4238e6b5dca2bbc0fb04f64c67f3e0bc3586.tar.bz2
portage-d66f4238e6b5dca2bbc0fb04f64c67f3e0bc3586.zip
pid-sandbox: handle EnvironmentError for python2 compat (bug 675868)
The fcntl.ioctl call raises IOError, which is different from OSError for python2. Use EnvironmentError for compatibility. Bug: https://bugs.gentoo.org/675868 Reported-by: Ivan Ivanich <ivanich@ivanich.org.ua> Fixes: ce0656337268 ("pid-sandbox: pid-ns-init TIOCSCTTY after setsid (bug 675868)") Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'bin')
-rw-r--r--bin/pid-ns-init4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/pid-ns-init b/bin/pid-ns-init
index d8e67cf6d..cfbd65280 100644
--- a/bin/pid-ns-init
+++ b/bin/pid-ns-init
@@ -80,7 +80,7 @@ def main(argv):
if sys.stdout.isatty():
try:
fcntl.ioctl(sys.stdout, termios.TIOCSCTTY, 0)
- except OSError as e:
+ except EnvironmentError as e:
if e.errno == errno.EPERM:
# This means that stdout refers to the controlling terminal
# of the parent process, and in this case we do not want to
@@ -101,7 +101,7 @@ def main(argv):
while True:
try:
pid, status = os.wait()
- except OSError as e:
+ except EnvironmentError as e:
if e.errno == errno.EINTR:
continue
raise