forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-112136: Restore removed _PyArg_Parser
Restore removed private _PyArg_Parser structure and private _PyArg_ParseTupleAndKeywordsFast() function. Recreate Include/cpython/modsupport.h header file.
- Loading branch information
Showing
8 changed files
with
39 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef Py_CPYTHON_MODSUPPORT_H | ||
# error "this header file must not be included directly" | ||
#endif | ||
|
||
// A data structure that can be used to run initialization code once in a | ||
// thread-safe manner. The C++11 equivalent is std::call_once. | ||
typedef struct { | ||
uint8_t v; | ||
} _PyOnceFlag; | ||
|
||
typedef struct _PyArg_Parser { | ||
const char *format; | ||
const char * const *keywords; | ||
const char *fname; | ||
const char *custom_msg; | ||
_PyOnceFlag once; /* atomic one-time initialization flag */ | ||
int is_kwtuple_owned; /* does this parser own the kwtuple object? */ | ||
int pos; /* number of positional-only arguments */ | ||
int min; /* minimal number of arguments */ | ||
int max; /* maximal number of positional arguments */ | ||
PyObject *kwtuple; /* tuple of keyword parameter names */ | ||
struct _PyArg_Parser *next; | ||
} _PyArg_Parser; | ||
|
||
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *, | ||
struct _PyArg_Parser *, ...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/C API/2024-07-02-11-03-40.gh-issue-112136.f3fiY8.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Restore removed private ``_PyArg_Parser`` structure and private | ||
``_PyArg_ParseTupleAndKeywordsFast()`` function. Patch by Victor Stinner. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters