]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #12567: Fix curses.unget_wch() tests
authorVictor Stinner <vstinner@wyplay.com>
Tue, 6 Sep 2011 08:08:28 +0000 (10:08 +0200)
committerVictor Stinner <vstinner@wyplay.com>
Tue, 6 Sep 2011 08:08:28 +0000 (10:08 +0200)
Skip the test if the function is missing. Use U+0061 (a) instead of U+00E9 (é)
because U+00E9 raises a _curses.error('unget_wch() returned ERR') on some
buildbots. It's maybe because of the locale encoding.

Lib/test/test_curses.py

index 8caf0deaef0bca7379277b10e634f6ca50cc598c..b4673e9863817a96fde599bab7a80eb021b762ff 100644 (file)
@@ -265,14 +265,16 @@ def test_issue6243(stdscr):
     stdscr.getkey()
 
 def test_unget_wch(stdscr):
-    ch = '\xe9'
+    if not hasattr(curses, 'unget_wch'):
+        return
+    ch = 'a'
     curses.unget_wch(ch)
     read = stdscr.get_wch()
     read = chr(read)
     if read != ch:
         raise AssertionError("%r != %r" % (read, ch))
 
-    ch = ord('\xe9')
+    ch = ord('a')
     curses.unget_wch(ch)
     read = stdscr.get_wch()
     if read != ch: