bpo-46000: Improve NetBSD curses compatibility (GH-29947)

This commit is contained in:
Thomas Klausner 2021-12-10 10:41:47 +01:00 committed by GitHub
parent 8c74713d0e
commit 2fb797e93c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -0,0 +1 @@
Improve compatibility of the :mod:`curses` module with NetBSD curses.

View file

@ -1230,8 +1230,8 @@ PyCursesWindow_ChgAt(PyCursesWindowObject *self, PyObject *args)
return NULL; return NULL;
} }
color = (short)((attr >> 8) & 0xff); color = (short) PAIR_NUMBER(attr);
attr = attr - (color << 8); attr = attr & A_ATTRIBUTES;
if (use_xy) { if (use_xy) {
rtn = mvwchgat(self->win,y,x,num,attr,color,NULL); rtn = mvwchgat(self->win,y,x,num,attr,color,NULL);