mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
initscr() will exit if there's an error. Try to catch the obvious failure
cases if TERM isn't set or is unknown (perhaps we should only check if unset or empty?) Skip the test if TERM isn't set. This seems to occur when running under buildbot and presumably cron. For some more info check here: http://mail.python.org/pipermail/python-checkins/2006-January/048704.html Will backport if it works.
This commit is contained in:
parent
a9652f11ad
commit
9f39f68533
1 changed files with 7 additions and 4 deletions
|
@ -14,10 +14,13 @@ import curses, sys, tempfile, os
|
||||||
# 'curses' resource be given on the regrtest command line using the -u
|
# 'curses' resource be given on the regrtest command line using the -u
|
||||||
# option. If not available, nothing after this line will be executed.
|
# option. If not available, nothing after this line will be executed.
|
||||||
|
|
||||||
from test import test_support
|
from test.test_support import requires, TestSkipped
|
||||||
test_support.requires('curses')
|
requires('curses')
|
||||||
if not os.isatty(sys.stdin.fileno()):
|
|
||||||
raise test_support.TestSkipped, "stdin is not a tty"
|
# XXX: if newterm was supported we could use it instead of initscr and not exit
|
||||||
|
term = os.environ.get('TERM')
|
||||||
|
if not term or term == 'unknown':
|
||||||
|
raise TestSkipped, "$TERM=%r, calling initscr() may cause exit" % term
|
||||||
|
|
||||||
def window_funcs(stdscr):
|
def window_funcs(stdscr):
|
||||||
"Test the methods of windows"
|
"Test the methods of windows"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue