[Python-checkins] cpython (2.7): Issue #26476: Fixed compilation error when use PyErr_BadInternalCall() in C++.

serhiy.storchaka python-checkins at python.org
Thu Mar 3 11:16:51 EST 2016


https://hg.python.org/cpython/rev/0e3526ab6a9b
changeset:   100407:0e3526ab6a9b
branch:      2.7
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Thu Mar 03 18:16:27 2016 +0200
summary:
  Issue #26476: Fixed compilation error when use PyErr_BadInternalCall() in C++.
Patch by Jeroen Demeyer.

files:
  Include/pyerrors.h |  2 +-
  Misc/NEWS          |  6 ++++++
  Python/errors.c    |  2 +-
  3 files changed, 8 insertions(+), 2 deletions(-)


diff --git a/Include/pyerrors.h b/Include/pyerrors.h
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -215,7 +215,7 @@
 
 /* Export the old function so that the existing API remains available: */
 PyAPI_FUNC(void) PyErr_BadInternalCall(void);
-PyAPI_FUNC(void) _PyErr_BadInternalCall(char *filename, int lineno);
+PyAPI_FUNC(void) _PyErr_BadInternalCall(const char *filename, int lineno);
 /* Mask the old API with a call to the new API for code compiled under
    Python 2.0: */
 #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -174,6 +174,12 @@
 
 - Issue #25136: Support Apple Xcode 7's new textual SDK stub libraries.
 
+C API
+-----
+
+- Issue #26476: Fixed compilation error when use PyErr_BadInternalCall() in C++.
+  Patch by Jeroen Demeyer.
+
 
 What's New in Python 2.7.11?
 ============================
diff --git a/Python/errors.c b/Python/errors.c
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -532,7 +532,7 @@
 #endif /* MS_WINDOWS */
 
 void
-_PyErr_BadInternalCall(char *filename, int lineno)
+_PyErr_BadInternalCall(const char *filename, int lineno)
 {
     PyErr_Format(PyExc_SystemError,
                  "%s:%d: bad argument to internal function",

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list