summaryrefslogtreecommitdiff
path: root/Lib/test/test_curses.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_curses.py')
-rw-r--r--Lib/test/test_curses.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index ed93946229..3f43c11edd 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -9,16 +9,19 @@
# Only called, not tested: getmouse(), ungetmouse()
#
-import curses, sys, tempfile, os
-import curses.panel
+import sys, tempfile, os
# Optionally test curses module. This currently requires that the
# 'curses' resource be given on the regrtest command line using the -u
# option. If not available, nothing after this line will be executed.
-from test.support import requires
+from test.support import requires, import_module
requires('curses')
+# If either of these don't exist, skip the tests.
+curses = import_module('curses')
+curses.panel = import_module('curses.panel')
+
# 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':