- use an OS independant way of identifying base module directory - use a more portable way of reading stty output
This commit is contained in:
parent
4db660b86c
commit
3f40fb2de7
2 changed files with 8 additions and 5 deletions
|
|
@ -20,6 +20,8 @@ from __future__ import with_statement
|
|||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
import tty, termios
|
||||
except ImportError:
|
||||
|
|
@ -83,7 +85,7 @@ class IFormatter(object):
|
|||
# XXX if stdin is not a tty, it seems that the command fails.
|
||||
|
||||
if os.isatty(sys.stdout.fileno()) and os.isatty(sys.stdin.fileno()):
|
||||
self.termrows = int(os.popen('stty size', 'r').read().split()[0])
|
||||
self.termrows = int( subprocess.Popen('stty size', stdout=subprocess.PIPE).communicate()[0].split()[0])
|
||||
|
||||
def after_format(self, formatted):
|
||||
if self.outfile != sys.stdout:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue