]> granicus.if.org Git - python/commitdiff
In some environments (under screen, in a chroot) curses doesn't support
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 6 Apr 2006 07:12:39 +0000 (07:12 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 6 Apr 2006 07:12:39 +0000 (07:12 +0000)
mouse events. This makes the test fail. Catch that case and don't run
the tests. Should make the debian/ubuntu buildbots that run in a chroot
work again.

Will backport to release24-maint.

Lib/test/test_curses.py

index 126251eda954092629b58a9e753d77764f8a2c1a..dc2f20bd518f5672e4f6895c263021ba347328a0 100644 (file)
@@ -204,11 +204,13 @@ def module_funcs(stdscr):
         curses.has_key(13)
 
     if hasattr(curses, 'getmouse'):
-        curses.mousemask(curses.BUTTON1_PRESSED)
-        curses.mouseinterval(10)
-        # just verify these don't cause errors
-        m = curses.getmouse()
-        curses.ungetmouse(*m)
+        (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED)
+        # availmask indicates that mouse stuff not available.
+        if availmask != 0:
+            curses.mouseinterval(10)
+            # just verify these don't cause errors
+            m = curses.getmouse()
+            curses.ungetmouse(*m)
 
 def unit_tests():
     from curses import ascii