Skip to content

Commit bb76410

Browse files
bpo-46000: Improve NetBSD curses compatibility (GH-29947)
(cherry picked from commit 2fb797e) Co-authored-by: Thomas Klausner <[email protected]>
1 parent 64c2788 commit bb76410

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,8 @@ PyCursesWindow_ChgAt(PyCursesWindowObject *self, PyObject *args)
12261226
return NULL;
12271227
}
12281228

1229-
color = (short)((attr >> 8) & 0xff);
1230-
attr = attr - (color << 8);
1229+
color = (short) PAIR_NUMBER(attr);
1230+
attr = attr & A_ATTRIBUTES;
12311231

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

0 commit comments

Comments
 (0)