1414import os as _os
1515import sys as _sys
1616
17- # Some constants, most notably the ACS_* ones, are only added to the C
18- # _curses module's dictionary after initscr() is called. (Some
17+ # Some constants, most notably the ACS_* and WACS_* ones, are only added
18+ # to the C _curses module's dictionary after initscr() is called. (Some
1919# versions of SGI's curses don't define values for those constants
2020# until initscr() has been called.) This wrapper function calls the
2121# underlying C initscr(), and then copies the constants from the
@@ -30,13 +30,13 @@ def initscr():
3030 fd = _sys .__stdout__ .fileno ())
3131 stdscr = _curses .initscr ()
3232 for key , value in _curses .__dict__ .items ():
33- if key .startswith ('ACS_' ) or key in ('LINES' , 'COLS' ):
33+ if key .startswith (( 'ACS_' , 'WACS_' ) ) or key in ('LINES' , 'COLS' ):
3434 setattr (curses , key , value )
3535 return stdscr
3636
37- # newterm() is wrapped for the same reason as initscr(): the ACS_* constants
38- # and LINES/COLS only become available once a terminal is initialized, and are
39- # then copied to the curses package's dictionary.
37+ # newterm() is wrapped for the same reason as initscr(): the ACS_* and WACS_*
38+ # constants and LINES/COLS only become available once a terminal is
39+ # initialized, and are then copied to the curses package's dictionary.
4040
4141try :
4242 newterm
@@ -47,7 +47,7 @@ def newterm(type=None, fd=None, infd=None, /):
4747 import _curses , curses
4848 screen = _curses .newterm (type , fd , infd )
4949 for key , value in _curses .__dict__ .items ():
50- if key .startswith ('ACS_' ) or key in ('LINES' , 'COLS' ):
50+ if key .startswith (( 'ACS_' , 'WACS_' ) ) or key in ('LINES' , 'COLS' ):
5151 setattr (curses , key , value )
5252 return screen
5353
0 commit comments