[Python-checkins] bpo-44113: Fix compiler warning in PySys_AddWarnOption() (GH-26084)

vstinner webhook-mailer at python.org
Wed May 12 20:28:00 EDT 2021


https://github.com/python/cpython/commit/ec7c09b9bc9a8f333a0295b41ea88986c320448c
commit: ec7c09b9bc9a8f333a0295b41ea88986c320448c
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2021-05-13T02:27:56+02:00
summary:

bpo-44113: Fix compiler warning in PySys_AddWarnOption() (GH-26084)

Ignore Py_DEPRECATED() warning on purpose.

files:
M Python/sysmodule.c

diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index ac49f7867a5cb..f1f4492f83c7b 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2293,7 +2293,10 @@ PySys_AddWarnOption(const wchar_t *s)
     unicode = PyUnicode_FromWideChar(s, -1);
     if (unicode == NULL)
         return;
+_Py_COMP_DIAG_PUSH
+_Py_COMP_DIAG_IGNORE_DEPR_DECLS
     PySys_AddWarnOptionUnicode(unicode);
+_Py_COMP_DIAG_POP
     Py_DECREF(unicode);
 }
 



More information about the Python-checkins mailing list