diff options
Diffstat (limited to 'Lib/curses/wrapper.py')
-rw-r--r-- | Lib/curses/wrapper.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/curses/wrapper.py b/Lib/curses/wrapper.py index e7e7bb6..51fb724 100644 --- a/Lib/curses/wrapper.py +++ b/Lib/curses/wrapper.py @@ -32,6 +32,15 @@ def wrapper(func, *rest): # a special value like curses.KEY_LEFT will be returned stdscr.keypad(1) + # Start color, too. Harmless if the terminal doesn't have + # color; user can test with has_color() later on. The try/catch + # works around a minor bit of over-conscientiousness in the curses + # module -- the error return from C start_color() is ignorable. + try: + curses.start_color() + except: + pass + res = apply(func, (stdscr,) + rest) except: # In the event of an error, restore the terminal |