2 from locale
import getpreferredencoding
4 # addstrwrapped: wrapper for curses' addstr which gets around compatibility
5 # issues between python 2.x and python 3.x.
6 # s should be a unicode string in 2.x, or a string in 3.x
7 def addstrwrapped(scr
, y
, x
, s
, attr
=0):
8 if sys
.hexversion
> 0x03000000:
10 return scr
.addstr(s
, attr
)
11 return scr
.addstr(y
, x
, s
, attr
)
14 return scr
.addstr(s
.encode(getpreferredencoding(), "replace"), attr
)
15 return scr
.addstr(y
, x
, s
.encode(getpreferredencoding(), "replace"), attr
)
19 if sys
.hexversion
> 0x03000000:
24 if sys
.hexversion
> 0x03000000:
25 from curses
import wrapper
26 curseswrapper
= wrapper
28 from curses
.wrapper
import wrapper
29 curseswrapper
= wrapper