summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-03-02 09:42:20 +0000
committerZac Medico <zmedico@gentoo.org>2010-03-02 09:42:20 +0000
commit4e61f693d4f5c4c2c6dcd545be4cfb99df11dc58 (patch)
tree185db03ffc4dfbcc2b5ed20f9d5c7df6470340de
parent398c490c16b548cacb62c25e12a9fe7a4106c720 (diff)
downloadportage-4e61f693d4f5c4c2c6dcd545be4cfb99df11dc58.tar.gz
portage-4e61f693d4f5c4c2c6dcd545be4cfb99df11dc58.tar.bz2
portage-4e61f693d4f5c4c2c6dcd545be4cfb99df11dc58.zip
Move imports to top.
svn path=/main/trunk/; revision=15514
-rw-r--r--pym/portage/package/ebuild/_pty.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/pym/portage/package/ebuild/_pty.py b/pym/portage/package/ebuild/_pty.py
index f67ca09c4..c48584f58 100644
--- a/pym/portage/package/ebuild/_pty.py
+++ b/pym/portage/package/ebuild/_pty.py
@@ -11,6 +11,7 @@ import sys
import termios
from portage import os, _unicode_decode, _unicode_encode
+from portage.output import get_term_size, set_term_size
from portage.process import spawn_bash
from portage.util import writemsg
@@ -178,9 +179,8 @@ def _create_pty_or_pipe(copy_term_size=None):
if _disable_openpty:
master_fd, slave_fd = os.pipe()
else:
- from pty import openpty
try:
- master_fd, slave_fd = openpty()
+ master_fd, slave_fd = pty.openpty()
got_pty = True
except EnvironmentError as e:
_disable_openpty = True
@@ -192,7 +192,6 @@ def _create_pty_or_pipe(copy_term_size=None):
if got_pty:
# Disable post-processing of output since otherwise weird
# things like \n -> \r\n transformations may occur.
- import termios
mode = termios.tcgetattr(slave_fd)
mode[1] &= ~termios.OPOST
termios.tcsetattr(slave_fd, termios.TCSANOW, mode)
@@ -200,7 +199,6 @@ def _create_pty_or_pipe(copy_term_size=None):
if got_pty and \
copy_term_size is not None and \
os.isatty(copy_term_size):
- from portage.output import get_term_size, set_term_size
rows, columns = get_term_size()
set_term_size(rows, columns, slave_fd)