Skip to content

Commit 2fb797e

Browse files
authored
bpo-46000: Improve NetBSD curses compatibility (GH-29947)
1 parent 8c74713 commit 2fb797e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve compatibility of the :mod:`curses` module with NetBSD curses.

Modules/_cursesmodule.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1230,8 +1230,8 @@ PyCursesWindow_ChgAt(PyCursesWindowObject *self, PyObject *args)
12301230
return NULL;
12311231
}
12321232

1233-
color = (short)((attr >> 8) & 0xff);
1234-
attr = attr - (color << 8);
1233+
color = (short) PAIR_NUMBER(attr);
1234+
attr = attr & A_ATTRIBUTES;
12351235

12361236
if (use_xy) {
12371237
rtn = mvwchgat(self->win,y,x,num,attr,color,NULL);

0 commit comments

Comments
 (0)