Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite007e62

Browse files
authored
gh-125843: fixtest_curses.test_attributes on x86-64 macOS (#134252)
While some `libcurses` functions are meant to return OK on success,this is not always the case for all implementations. As such, we relaxthe checks on the return values and allow any non-ERR value to beconsidered equivalent to OK.
1 parent28625d4 commite007e62

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎Modules/_cursesmodule.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,16 @@ _PyCursesStatefulCheckFunction(PyObject *module,
392392
*/
393393

394394
/*
395-
* Return None if 'code' isOK. Otherwise, set an exception
396-
* using curses_set_error() and the remaining arguments, and
397-
* return NULL.
395+
* Return None if 'code' isdifferent from ERR (implementation-defined).
396+
*Otherwise, set an exceptionusing curses_set_error() and the remaining
397+
*arguments, andreturn NULL.
398398
*/
399399
staticPyObject*
400400
curses_check_err(PyObject*module,intcode,
401401
constchar*curses_funcname,
402402
constchar*python_funcname)
403403
{
404404
if (code!=ERR) {
405-
assert(code==OK);
406405
Py_RETURN_NONE;
407406
}
408407
curses_set_error(module,curses_funcname,python_funcname);
@@ -416,7 +415,6 @@ curses_window_check_err(PyCursesWindowObject *win, int code,
416415
constchar*python_funcname)
417416
{
418417
if (code!=ERR) {
419-
assert(code==OK);
420418
Py_RETURN_NONE;
421419
}
422420
curses_window_set_error(win,curses_funcname,python_funcname);
@@ -1580,7 +1578,7 @@ _curses_window_derwin_impl(PyCursesWindowObject *self, int group_left_1,
15801578
win=derwin(self->win,nlines,ncols,begin_y,begin_x);
15811579

15821580
if (win==NULL) {
1583-
curses_window_set_error(self,"derwin",NULL);
1581+
curses_window_set_null_error(self,"derwin",NULL);
15841582
returnNULL;
15851583
}
15861584

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp