Skip to content

Commit 040f9f9

Browse files
bpo-46000: Improve NetBSD curses compatibility (pythonGH-29947) (pythonGH-30023)
(cherry picked from commit 2fb797e) Co-authored-by: Thomas Klausner <tk@giga.or.at>
1 parent 40d7652 commit 040f9f9

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
@@ -1077,8 +1077,8 @@ PyCursesWindow_ChgAt(PyCursesWindowObject *self, PyObject *args)
10771077
return NULL;
10781078
}
10791079

1080-
color = (short)((attr >> 8) & 0xff);
1081-
attr = attr - (color << 8);
1080+
color = (short) PAIR_NUMBER(attr);
1081+
attr = attr & A_ATTRIBUTES;
10821082

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

0 commit comments

Comments
 (0)