diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/python3/src/Modules/clinic/_pickle.c.h | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Modules/clinic/_pickle.c.h')
-rw-r--r-- | contrib/tools/python3/src/Modules/clinic/_pickle.c.h | 680 |
1 files changed, 340 insertions, 340 deletions
diff --git a/contrib/tools/python3/src/Modules/clinic/_pickle.c.h b/contrib/tools/python3/src/Modules/clinic/_pickle.c.h index 715be653a3..136524b6a7 100644 --- a/contrib/tools/python3/src/Modules/clinic/_pickle.c.h +++ b/contrib/tools/python3/src/Modules/clinic/_pickle.c.h @@ -63,15 +63,15 @@ exit: } PyDoc_STRVAR(_pickle_Pickler___init____doc__, -"Pickler(file, protocol=None, fix_imports=True, buffer_callback=None)\n" +"Pickler(file, protocol=None, fix_imports=True, buffer_callback=None)\n" "--\n" "\n" "This takes a binary file for writing a pickle data stream.\n" "\n" "The optional *protocol* argument tells the pickler to use the given\n" -"protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default\n" -"protocol is 4. It was introduced in Python 3.4, and is incompatible\n" -"with previous versions.\n" +"protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default\n" +"protocol is 4. It was introduced in Python 3.4, and is incompatible\n" +"with previous versions.\n" "\n" "Specifying a negative protocol version selects the highest protocol\n" "version supported. The higher the protocol used, the more recent the\n" @@ -84,65 +84,65 @@ PyDoc_STRVAR(_pickle_Pickler___init____doc__, "\n" "If *fix_imports* is True and protocol is less than 3, pickle will try\n" "to map the new Python 3 names to the old module names used in Python\n" -"2, so that the pickle data stream is readable with Python 2.\n" -"\n" -"If *buffer_callback* is None (the default), buffer views are\n" -"serialized into *file* as part of the pickle stream.\n" -"\n" -"If *buffer_callback* is not None, then it can be called any number\n" -"of times with a buffer view. If the callback returns a false value\n" -"(such as None), the given buffer is out-of-band; otherwise the\n" -"buffer is serialized in-band, i.e. inside the pickle stream.\n" -"\n" -"It is an error if *buffer_callback* is not None and *protocol*\n" -"is None or smaller than 5."); +"2, so that the pickle data stream is readable with Python 2.\n" +"\n" +"If *buffer_callback* is None (the default), buffer views are\n" +"serialized into *file* as part of the pickle stream.\n" +"\n" +"If *buffer_callback* is not None, then it can be called any number\n" +"of times with a buffer view. If the callback returns a false value\n" +"(such as None), the given buffer is out-of-band; otherwise the\n" +"buffer is serialized in-band, i.e. inside the pickle stream.\n" +"\n" +"It is an error if *buffer_callback* is not None and *protocol*\n" +"is None or smaller than 5."); static int _pickle_Pickler___init___impl(PicklerObject *self, PyObject *file, - PyObject *protocol, int fix_imports, - PyObject *buffer_callback); + PyObject *protocol, int fix_imports, + PyObject *buffer_callback); static int _pickle_Pickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - static const char * const _keywords[] = {"file", "protocol", "fix_imports", "buffer_callback", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "Pickler", 0}; - PyObject *argsbuf[4]; - PyObject * const *fastargs; - Py_ssize_t nargs = PyTuple_GET_SIZE(args); - Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1; + static const char * const _keywords[] = {"file", "protocol", "fix_imports", "buffer_callback", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "Pickler", 0}; + PyObject *argsbuf[4]; + PyObject * const *fastargs; + Py_ssize_t nargs = PyTuple_GET_SIZE(args); + Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1; PyObject *file; - PyObject *protocol = Py_None; + PyObject *protocol = Py_None; int fix_imports = 1; - PyObject *buffer_callback = Py_None; + PyObject *buffer_callback = Py_None; - fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 4, 0, argsbuf); - if (!fastargs) { + fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 4, 0, argsbuf); + if (!fastargs) { goto exit; } - file = fastargs[0]; - if (!noptargs) { - goto skip_optional_pos; - } - if (fastargs[1]) { - protocol = fastargs[1]; - if (!--noptargs) { - goto skip_optional_pos; - } - } - if (fastargs[2]) { - fix_imports = PyObject_IsTrue(fastargs[2]); - if (fix_imports < 0) { - goto exit; - } - if (!--noptargs) { - goto skip_optional_pos; - } - } - buffer_callback = fastargs[3]; -skip_optional_pos: - return_value = _pickle_Pickler___init___impl((PicklerObject *)self, file, protocol, fix_imports, buffer_callback); + file = fastargs[0]; + if (!noptargs) { + goto skip_optional_pos; + } + if (fastargs[1]) { + protocol = fastargs[1]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + if (fastargs[2]) { + fix_imports = PyObject_IsTrue(fastargs[2]); + if (fix_imports < 0) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_pos; + } + } + buffer_callback = fastargs[3]; +skip_optional_pos: + return_value = _pickle_Pickler___init___impl((PicklerObject *)self, file, protocol, fix_imports, buffer_callback); exit: return return_value; @@ -238,7 +238,7 @@ PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__, "needed. Both arguments passed are str objects."); #define _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF \ - {"find_class", (PyCFunction)(void(*)(void))_pickle_Unpickler_find_class, METH_FASTCALL, _pickle_Unpickler_find_class__doc__}, + {"find_class", (PyCFunction)(void(*)(void))_pickle_Unpickler_find_class, METH_FASTCALL, _pickle_Unpickler_find_class__doc__}, static PyObject * _pickle_Unpickler_find_class_impl(UnpicklerObject *self, @@ -252,11 +252,11 @@ _pickle_Unpickler_find_class(UnpicklerObject *self, PyObject *const *args, Py_ss PyObject *module_name; PyObject *global_name; - if (!_PyArg_CheckPositional("find_class", nargs, 2, 2)) { + if (!_PyArg_CheckPositional("find_class", nargs, 2, 2)) { goto exit; } - module_name = args[0]; - global_name = args[1]; + module_name = args[0]; + global_name = args[1]; return_value = _pickle_Unpickler_find_class_impl(self, module_name, global_name); exit: @@ -292,8 +292,8 @@ exit: } PyDoc_STRVAR(_pickle_Unpickler___init____doc__, -"Unpickler(file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\',\n" -" buffers=())\n" +"Unpickler(file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\',\n" +" buffers=())\n" "--\n" "\n" "This takes a binary file for reading a pickle data stream.\n" @@ -320,80 +320,80 @@ PyDoc_STRVAR(_pickle_Unpickler___init____doc__, static int _pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, - const char *errors, PyObject *buffers); + const char *errors, PyObject *buffers); static int _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) { int return_value = -1; - static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", "buffers", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "Unpickler", 0}; - PyObject *argsbuf[5]; - PyObject * const *fastargs; - Py_ssize_t nargs = PyTuple_GET_SIZE(args); - Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1; + static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", "buffers", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "Unpickler", 0}; + PyObject *argsbuf[5]; + PyObject * const *fastargs; + Py_ssize_t nargs = PyTuple_GET_SIZE(args); + Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1; PyObject *file; int fix_imports = 1; const char *encoding = "ASCII"; const char *errors = "strict"; - PyObject *buffers = NULL; + PyObject *buffers = NULL; - fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf); - if (!fastargs) { + fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf); + if (!fastargs) { goto exit; } - file = fastargs[0]; - if (!noptargs) { - goto skip_optional_kwonly; - } - if (fastargs[1]) { - fix_imports = PyObject_IsTrue(fastargs[1]); - if (fix_imports < 0) { - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - if (fastargs[2]) { - if (!PyUnicode_Check(fastargs[2])) { - _PyArg_BadArgument("Unpickler", "argument 'encoding'", "str", fastargs[2]); - goto exit; - } - Py_ssize_t encoding_length; - encoding = PyUnicode_AsUTF8AndSize(fastargs[2], &encoding_length); - if (encoding == NULL) { - goto exit; - } - if (strlen(encoding) != (size_t)encoding_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - if (fastargs[3]) { - if (!PyUnicode_Check(fastargs[3])) { - _PyArg_BadArgument("Unpickler", "argument 'errors'", "str", fastargs[3]); - goto exit; - } - Py_ssize_t errors_length; - errors = PyUnicode_AsUTF8AndSize(fastargs[3], &errors_length); - if (errors == NULL) { - goto exit; - } - if (strlen(errors) != (size_t)errors_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - buffers = fastargs[4]; -skip_optional_kwonly: - return_value = _pickle_Unpickler___init___impl((UnpicklerObject *)self, file, fix_imports, encoding, errors, buffers); + file = fastargs[0]; + if (!noptargs) { + goto skip_optional_kwonly; + } + if (fastargs[1]) { + fix_imports = PyObject_IsTrue(fastargs[1]); + if (fix_imports < 0) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + if (fastargs[2]) { + if (!PyUnicode_Check(fastargs[2])) { + _PyArg_BadArgument("Unpickler", "argument 'encoding'", "str", fastargs[2]); + goto exit; + } + Py_ssize_t encoding_length; + encoding = PyUnicode_AsUTF8AndSize(fastargs[2], &encoding_length); + if (encoding == NULL) { + goto exit; + } + if (strlen(encoding) != (size_t)encoding_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + if (fastargs[3]) { + if (!PyUnicode_Check(fastargs[3])) { + _PyArg_BadArgument("Unpickler", "argument 'errors'", "str", fastargs[3]); + goto exit; + } + Py_ssize_t errors_length; + errors = PyUnicode_AsUTF8AndSize(fastargs[3], &errors_length); + if (errors == NULL) { + goto exit; + } + if (strlen(errors) != (size_t)errors_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + buffers = fastargs[4]; +skip_optional_kwonly: + return_value = _pickle_Unpickler___init___impl((UnpicklerObject *)self, file, fix_imports, encoding, errors, buffers); exit: return return_value; @@ -454,8 +454,8 @@ _pickle_UnpicklerMemoProxy___reduce__(UnpicklerMemoProxyObject *self, PyObject * } PyDoc_STRVAR(_pickle_dump__doc__, -"dump($module, /, obj, file, protocol=None, *, fix_imports=True,\n" -" buffer_callback=None)\n" +"dump($module, /, obj, file, protocol=None, *, fix_imports=True,\n" +" buffer_callback=None)\n" "--\n" "\n" "Write a pickled representation of obj to the open file object file.\n" @@ -464,9 +464,9 @@ PyDoc_STRVAR(_pickle_dump__doc__, "be more efficient.\n" "\n" "The optional *protocol* argument tells the pickler to use the given\n" -"protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default\n" -"protocol is 4. It was introduced in Python 3.4, and is incompatible\n" -"with previous versions.\n" +"protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default\n" +"protocol is 4. It was introduced in Python 3.4, and is incompatible\n" +"with previous versions.\n" "\n" "Specifying a negative protocol version selects the highest protocol\n" "version supported. The higher the protocol used, the more recent the\n" @@ -479,81 +479,81 @@ PyDoc_STRVAR(_pickle_dump__doc__, "\n" "If *fix_imports* is True and protocol is less than 3, pickle will try\n" "to map the new Python 3 names to the old module names used in Python\n" -"2, so that the pickle data stream is readable with Python 2.\n" -"\n" -"If *buffer_callback* is None (the default), buffer views are serialized\n" -"into *file* as part of the pickle stream. It is an error if\n" -"*buffer_callback* is not None and *protocol* is None or smaller than 5."); +"2, so that the pickle data stream is readable with Python 2.\n" +"\n" +"If *buffer_callback* is None (the default), buffer views are serialized\n" +"into *file* as part of the pickle stream. It is an error if\n" +"*buffer_callback* is not None and *protocol* is None or smaller than 5."); #define _PICKLE_DUMP_METHODDEF \ - {"dump", (PyCFunction)(void(*)(void))_pickle_dump, METH_FASTCALL|METH_KEYWORDS, _pickle_dump__doc__}, + {"dump", (PyCFunction)(void(*)(void))_pickle_dump, METH_FASTCALL|METH_KEYWORDS, _pickle_dump__doc__}, static PyObject * _pickle_dump_impl(PyObject *module, PyObject *obj, PyObject *file, - PyObject *protocol, int fix_imports, - PyObject *buffer_callback); + PyObject *protocol, int fix_imports, + PyObject *buffer_callback); static PyObject * _pickle_dump(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static const char * const _keywords[] = {"obj", "file", "protocol", "fix_imports", "buffer_callback", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "dump", 0}; - PyObject *argsbuf[5]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2; + static const char * const _keywords[] = {"obj", "file", "protocol", "fix_imports", "buffer_callback", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "dump", 0}; + PyObject *argsbuf[5]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2; PyObject *obj; PyObject *file; - PyObject *protocol = Py_None; + PyObject *protocol = Py_None; int fix_imports = 1; - PyObject *buffer_callback = Py_None; + PyObject *buffer_callback = Py_None; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf); + if (!args) { goto exit; } - obj = args[0]; - file = args[1]; - if (!noptargs) { - goto skip_optional_pos; - } - if (args[2]) { - protocol = args[2]; - if (!--noptargs) { - goto skip_optional_pos; - } - } -skip_optional_pos: - if (!noptargs) { - goto skip_optional_kwonly; - } - if (args[3]) { - fix_imports = PyObject_IsTrue(args[3]); - if (fix_imports < 0) { - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - buffer_callback = args[4]; -skip_optional_kwonly: - return_value = _pickle_dump_impl(module, obj, file, protocol, fix_imports, buffer_callback); + obj = args[0]; + file = args[1]; + if (!noptargs) { + goto skip_optional_pos; + } + if (args[2]) { + protocol = args[2]; + if (!--noptargs) { + goto skip_optional_pos; + } + } +skip_optional_pos: + if (!noptargs) { + goto skip_optional_kwonly; + } + if (args[3]) { + fix_imports = PyObject_IsTrue(args[3]); + if (fix_imports < 0) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + buffer_callback = args[4]; +skip_optional_kwonly: + return_value = _pickle_dump_impl(module, obj, file, protocol, fix_imports, buffer_callback); exit: return return_value; } PyDoc_STRVAR(_pickle_dumps__doc__, -"dumps($module, /, obj, protocol=None, *, fix_imports=True,\n" -" buffer_callback=None)\n" +"dumps($module, /, obj, protocol=None, *, fix_imports=True,\n" +" buffer_callback=None)\n" "--\n" "\n" "Return the pickled representation of the object as a bytes object.\n" "\n" "The optional *protocol* argument tells the pickler to use the given\n" -"protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default\n" -"protocol is 4. It was introduced in Python 3.4, and is incompatible\n" -"with previous versions.\n" +"protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default\n" +"protocol is 4. It was introduced in Python 3.4, and is incompatible\n" +"with previous versions.\n" "\n" "Specifying a negative protocol version selects the highest protocol\n" "version supported. The higher the protocol used, the more recent the\n" @@ -561,62 +561,62 @@ PyDoc_STRVAR(_pickle_dumps__doc__, "\n" "If *fix_imports* is True and *protocol* is less than 3, pickle will\n" "try to map the new Python 3 names to the old module names used in\n" -"Python 2, so that the pickle data stream is readable with Python 2.\n" -"\n" -"If *buffer_callback* is None (the default), buffer views are serialized\n" -"into *file* as part of the pickle stream. It is an error if\n" -"*buffer_callback* is not None and *protocol* is None or smaller than 5."); +"Python 2, so that the pickle data stream is readable with Python 2.\n" +"\n" +"If *buffer_callback* is None (the default), buffer views are serialized\n" +"into *file* as part of the pickle stream. It is an error if\n" +"*buffer_callback* is not None and *protocol* is None or smaller than 5."); #define _PICKLE_DUMPS_METHODDEF \ - {"dumps", (PyCFunction)(void(*)(void))_pickle_dumps, METH_FASTCALL|METH_KEYWORDS, _pickle_dumps__doc__}, + {"dumps", (PyCFunction)(void(*)(void))_pickle_dumps, METH_FASTCALL|METH_KEYWORDS, _pickle_dumps__doc__}, static PyObject * _pickle_dumps_impl(PyObject *module, PyObject *obj, PyObject *protocol, - int fix_imports, PyObject *buffer_callback); + int fix_imports, PyObject *buffer_callback); static PyObject * _pickle_dumps(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static const char * const _keywords[] = {"obj", "protocol", "fix_imports", "buffer_callback", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "dumps", 0}; - PyObject *argsbuf[4]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; + static const char * const _keywords[] = {"obj", "protocol", "fix_imports", "buffer_callback", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "dumps", 0}; + PyObject *argsbuf[4]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; PyObject *obj; - PyObject *protocol = Py_None; + PyObject *protocol = Py_None; int fix_imports = 1; - PyObject *buffer_callback = Py_None; + PyObject *buffer_callback = Py_None; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf); + if (!args) { goto exit; } - obj = args[0]; - if (!noptargs) { - goto skip_optional_pos; - } - if (args[1]) { - protocol = args[1]; - if (!--noptargs) { - goto skip_optional_pos; - } - } -skip_optional_pos: - if (!noptargs) { - goto skip_optional_kwonly; - } - if (args[2]) { - fix_imports = PyObject_IsTrue(args[2]); - if (fix_imports < 0) { - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - buffer_callback = args[3]; -skip_optional_kwonly: - return_value = _pickle_dumps_impl(module, obj, protocol, fix_imports, buffer_callback); + obj = args[0]; + if (!noptargs) { + goto skip_optional_pos; + } + if (args[1]) { + protocol = args[1]; + if (!--noptargs) { + goto skip_optional_pos; + } + } +skip_optional_pos: + if (!noptargs) { + goto skip_optional_kwonly; + } + if (args[2]) { + fix_imports = PyObject_IsTrue(args[2]); + if (fix_imports < 0) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + buffer_callback = args[3]; +skip_optional_kwonly: + return_value = _pickle_dumps_impl(module, obj, protocol, fix_imports, buffer_callback); exit: return return_value; @@ -624,7 +624,7 @@ exit: PyDoc_STRVAR(_pickle_load__doc__, "load($module, /, file, *, fix_imports=True, encoding=\'ASCII\',\n" -" errors=\'strict\', buffers=())\n" +" errors=\'strict\', buffers=())\n" "--\n" "\n" "Read and return an object from the pickle data stored in a file.\n" @@ -652,91 +652,91 @@ PyDoc_STRVAR(_pickle_load__doc__, "string instances as bytes objects."); #define _PICKLE_LOAD_METHODDEF \ - {"load", (PyCFunction)(void(*)(void))_pickle_load, METH_FASTCALL|METH_KEYWORDS, _pickle_load__doc__}, + {"load", (PyCFunction)(void(*)(void))_pickle_load, METH_FASTCALL|METH_KEYWORDS, _pickle_load__doc__}, static PyObject * _pickle_load_impl(PyObject *module, PyObject *file, int fix_imports, - const char *encoding, const char *errors, - PyObject *buffers); + const char *encoding, const char *errors, + PyObject *buffers); static PyObject * _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", "buffers", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "load", 0}; - PyObject *argsbuf[5]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; + static const char * const _keywords[] = {"file", "fix_imports", "encoding", "errors", "buffers", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "load", 0}; + PyObject *argsbuf[5]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; PyObject *file; int fix_imports = 1; const char *encoding = "ASCII"; const char *errors = "strict"; - PyObject *buffers = NULL; + PyObject *buffers = NULL; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { goto exit; } - file = args[0]; - if (!noptargs) { - goto skip_optional_kwonly; - } - if (args[1]) { - fix_imports = PyObject_IsTrue(args[1]); - if (fix_imports < 0) { - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - if (args[2]) { - if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("load", "argument 'encoding'", "str", args[2]); - goto exit; - } - Py_ssize_t encoding_length; - encoding = PyUnicode_AsUTF8AndSize(args[2], &encoding_length); - if (encoding == NULL) { - goto exit; - } - if (strlen(encoding) != (size_t)encoding_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - if (args[3]) { - if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("load", "argument 'errors'", "str", args[3]); - goto exit; - } - Py_ssize_t errors_length; - errors = PyUnicode_AsUTF8AndSize(args[3], &errors_length); - if (errors == NULL) { - goto exit; - } - if (strlen(errors) != (size_t)errors_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - buffers = args[4]; -skip_optional_kwonly: - return_value = _pickle_load_impl(module, file, fix_imports, encoding, errors, buffers); + file = args[0]; + if (!noptargs) { + goto skip_optional_kwonly; + } + if (args[1]) { + fix_imports = PyObject_IsTrue(args[1]); + if (fix_imports < 0) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + if (args[2]) { + if (!PyUnicode_Check(args[2])) { + _PyArg_BadArgument("load", "argument 'encoding'", "str", args[2]); + goto exit; + } + Py_ssize_t encoding_length; + encoding = PyUnicode_AsUTF8AndSize(args[2], &encoding_length); + if (encoding == NULL) { + goto exit; + } + if (strlen(encoding) != (size_t)encoding_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + if (args[3]) { + if (!PyUnicode_Check(args[3])) { + _PyArg_BadArgument("load", "argument 'errors'", "str", args[3]); + goto exit; + } + Py_ssize_t errors_length; + errors = PyUnicode_AsUTF8AndSize(args[3], &errors_length); + if (errors == NULL) { + goto exit; + } + if (strlen(errors) != (size_t)errors_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + buffers = args[4]; +skip_optional_kwonly: + return_value = _pickle_load_impl(module, file, fix_imports, encoding, errors, buffers); exit: return return_value; } PyDoc_STRVAR(_pickle_loads__doc__, -"loads($module, data, /, *, fix_imports=True, encoding=\'ASCII\',\n" -" errors=\'strict\', buffers=())\n" +"loads($module, data, /, *, fix_imports=True, encoding=\'ASCII\',\n" +" errors=\'strict\', buffers=())\n" "--\n" "\n" "Read and return an object from the given pickle data.\n" @@ -755,85 +755,85 @@ PyDoc_STRVAR(_pickle_loads__doc__, "string instances as bytes objects."); #define _PICKLE_LOADS_METHODDEF \ - {"loads", (PyCFunction)(void(*)(void))_pickle_loads, METH_FASTCALL|METH_KEYWORDS, _pickle_loads__doc__}, + {"loads", (PyCFunction)(void(*)(void))_pickle_loads, METH_FASTCALL|METH_KEYWORDS, _pickle_loads__doc__}, static PyObject * _pickle_loads_impl(PyObject *module, PyObject *data, int fix_imports, - const char *encoding, const char *errors, - PyObject *buffers); + const char *encoding, const char *errors, + PyObject *buffers); static PyObject * _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; - static const char * const _keywords[] = {"", "fix_imports", "encoding", "errors", "buffers", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "loads", 0}; - PyObject *argsbuf[5]; - Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; + static const char * const _keywords[] = {"", "fix_imports", "encoding", "errors", "buffers", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "loads", 0}; + PyObject *argsbuf[5]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; PyObject *data; int fix_imports = 1; const char *encoding = "ASCII"; const char *errors = "strict"; - PyObject *buffers = NULL; + PyObject *buffers = NULL; - args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); - if (!args) { + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { goto exit; } - data = args[0]; - if (!noptargs) { - goto skip_optional_kwonly; - } - if (args[1]) { - fix_imports = PyObject_IsTrue(args[1]); - if (fix_imports < 0) { - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - if (args[2]) { - if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("loads", "argument 'encoding'", "str", args[2]); - goto exit; - } - Py_ssize_t encoding_length; - encoding = PyUnicode_AsUTF8AndSize(args[2], &encoding_length); - if (encoding == NULL) { - goto exit; - } - if (strlen(encoding) != (size_t)encoding_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - if (args[3]) { - if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("loads", "argument 'errors'", "str", args[3]); - goto exit; - } - Py_ssize_t errors_length; - errors = PyUnicode_AsUTF8AndSize(args[3], &errors_length); - if (errors == NULL) { - goto exit; - } - if (strlen(errors) != (size_t)errors_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } - if (!--noptargs) { - goto skip_optional_kwonly; - } - } - buffers = args[4]; -skip_optional_kwonly: - return_value = _pickle_loads_impl(module, data, fix_imports, encoding, errors, buffers); + data = args[0]; + if (!noptargs) { + goto skip_optional_kwonly; + } + if (args[1]) { + fix_imports = PyObject_IsTrue(args[1]); + if (fix_imports < 0) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + if (args[2]) { + if (!PyUnicode_Check(args[2])) { + _PyArg_BadArgument("loads", "argument 'encoding'", "str", args[2]); + goto exit; + } + Py_ssize_t encoding_length; + encoding = PyUnicode_AsUTF8AndSize(args[2], &encoding_length); + if (encoding == NULL) { + goto exit; + } + if (strlen(encoding) != (size_t)encoding_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + if (args[3]) { + if (!PyUnicode_Check(args[3])) { + _PyArg_BadArgument("loads", "argument 'errors'", "str", args[3]); + goto exit; + } + Py_ssize_t errors_length; + errors = PyUnicode_AsUTF8AndSize(args[3], &errors_length); + if (errors == NULL) { + goto exit; + } + if (strlen(errors) != (size_t)errors_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (!--noptargs) { + goto skip_optional_kwonly; + } + } + buffers = args[4]; +skip_optional_kwonly: + return_value = _pickle_loads_impl(module, data, fix_imports, encoding, errors, buffers); exit: return return_value; } -/*[clinic end generated code: output=324aad69644beda2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=324aad69644beda2 input=a9049054013a1b77]*/ |