[Python-checkins] CVS: python/dist/src/Lib/curses wrapper.py,1.4,1.5
Eric S. Raymond
python-dev@python.org
Wed, 9 Aug 2000 14:11:10 -0700
Update of /cvsroot/python/python/dist/src/Lib/curses
In directory slayer.i.sourceforge.net:/tmp/cvs-serv28543/Lib/curses
Modified Files:
wrapper.py
Log Message:
Tweak curses.wrapper so it initializes colors if they are available.
Index: wrapper.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/curses/wrapper.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** wrapper.py 2000/07/07 21:02:22 1.4
--- wrapper.py 2000/08/09 21:11:07 1.5
***************
*** 33,36 ****
--- 33,45 ----
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: