From: Pablo Galindo Date: Sun, 21 Jun 2020 20:26:59 +0000 (+0100) Subject: [3.9] Do not emit deprecation warnings inside CPython for old parser APIs (GH-21025) X-Git-Tag: v3.9.0b4~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b1a311512fb74d47a7beb223b93e5f28f3f98ab;p=thirdparty%2FPython%2Fcpython.git [3.9] Do not emit deprecation warnings inside CPython for old parser APIs (GH-21025) --- diff --git a/Include/pythonrun.h b/Include/pythonrun.h index d6010053372a..57529072432e 100644 --- a/Include/pythonrun.h +++ b/Include/pythonrun.h @@ -72,15 +72,23 @@ PyAPI_FUNC(struct _mod *) PyParser_ASTFromFileObject( #define PyParser_SimpleParseFile(FP, S, B) \ PyParser_SimpleParseFileFlags(FP, S, B, 0) #endif -Py_DEPRECATED(3.9) PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, - int, int); + +#ifndef Py_BUILD_CORE +Py_DEPRECATED(3.9) +#endif +PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int, int); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 -Py_DEPRECATED(3.9) PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(const char *, - const char *, - int, int); +#ifndef Py_BUILD_CORE +Py_DEPRECATED(3.9) +#endif +PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(const char *, + const char *, + int, int); +#endif +#ifndef Py_BUILD_CORE +Py_DEPRECATED(3.9) #endif -Py_DEPRECATED(3.9) PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *, - int, int); +PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *, int, int); #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *, PyObject *, PyCompilerFlags *);