diff options
author | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 15:39:38 -0800 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 15:39:38 -0800 |
commit | 1a5780aabb550cae175ad8711e2f33ba644d0ddb (patch) | |
tree | 68e47eaafb4ccc17bbdb7668c6058984945b332d /Modules/clinic/sha256module.c.h | |
parent | 956c7cfa7111ab5458e2f69868a05b7b84fc6843 (diff) | |
parent | d1d8706cdb77e2adbbb4110338dcda0e1811f892 (diff) | |
download | cpython-1a5780aabb550cae175ad8711e2f33ba644d0ddb.tar.gz |
Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0].
Diffstat (limited to 'Modules/clinic/sha256module.c.h')
-rw-r--r-- | Modules/clinic/sha256module.c.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Modules/clinic/sha256module.c.h b/Modules/clinic/sha256module.c.h index 661569c4fe..115db500f4 100644 --- a/Modules/clinic/sha256module.c.h +++ b/Modules/clinic/sha256module.c.h @@ -72,21 +72,23 @@ PyDoc_STRVAR(_sha256_sha256__doc__, "Return a new SHA-256 hash object; optionally initialized with a string."); #define _SHA256_SHA256_METHODDEF \ - {"sha256", (PyCFunction)_sha256_sha256, METH_VARARGS|METH_KEYWORDS, _sha256_sha256__doc__}, + {"sha256", (PyCFunction)_sha256_sha256, METH_FASTCALL, _sha256_sha256__doc__}, static PyObject * _sha256_sha256_impl(PyObject *module, PyObject *string); static PyObject * -_sha256_sha256(PyObject *module, PyObject *args, PyObject *kwargs) +_sha256_sha256(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", NULL}; + static const char * const _keywords[] = {"string", NULL}; + static _PyArg_Parser _parser = {"|O:sha256", _keywords, 0}; PyObject *string = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:sha256", _keywords, - &string)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &string)) { goto exit; + } return_value = _sha256_sha256_impl(module, string); exit: @@ -100,24 +102,26 @@ PyDoc_STRVAR(_sha256_sha224__doc__, "Return a new SHA-224 hash object; optionally initialized with a string."); #define _SHA256_SHA224_METHODDEF \ - {"sha224", (PyCFunction)_sha256_sha224, METH_VARARGS|METH_KEYWORDS, _sha256_sha224__doc__}, + {"sha224", (PyCFunction)_sha256_sha224, METH_FASTCALL, _sha256_sha224__doc__}, static PyObject * _sha256_sha224_impl(PyObject *module, PyObject *string); static PyObject * -_sha256_sha224(PyObject *module, PyObject *args, PyObject *kwargs) +_sha256_sha224(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static char *_keywords[] = {"string", NULL}; + static const char * const _keywords[] = {"string", NULL}; + static _PyArg_Parser _parser = {"|O:sha224", _keywords, 0}; PyObject *string = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:sha224", _keywords, - &string)) + if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, + &string)) { goto exit; + } return_value = _sha256_sha224_impl(module, string); exit: return return_value; } -/*[clinic end generated code: output=5a1fc5480e399f95 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=19439d70db7ead5c input=a9049054013a1b77]*/ |