diff options
-rw-r--r-- | Modules/_cursesmodule.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 7e2699e..c10b2b3 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -383,6 +383,7 @@ PyCurses_ConvertToString(PyCursesWindowObject *win, PyObject *obj, return 0; /* check for embedded null bytes */ if (PyBytes_AsStringAndSize(*bytes, &str, NULL) < 0) { + Py_CLEAR(*bytes); return 0; } return 1; |