mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Backporting METH_FASTCALL from Python 3.7 (#317)
* dict copy speedup refer to bpo-31179 or python/cpython@boa7a037b8fde * __build_class__() uses METH_FASTCALL refer python/cpython@69de71b255 refer python/cpython@773dc6dd06 a single test related to __prepare__ fails. * type_prepare uses METH_FASTCALL refer python/cpython@d526cfe546 refer python/cpython@80ab22fa2c the prepare-related test still fails. It's just related to the error message format though. * separate into ParseStack and ParseStackAndKeywords refer python/cpython@6518a93cb1 refer python/cpython@3e1fad6913 refer python/cpython@c0083fc47d * Add _PyArg_NoStackKeywords refer python/cpython@29d39cc8f5 * _PyStack_UnpackDict now returns int refer python/cpython@998c20962c * METH_FASTCALL changes to .inc files done via python's Argument Clinic tool, refer python/cpython@259f0e4437 * Added _PyArg_UnpackStack refer python/cpython@fe54dda08 * Argument Clinic FASTCALL again refer python/cpython@0c4a828ca * Argument Clinic for ordered dictionary object refer python/cpython@b05cbac052 * speed up getargs refer python/cpython@1741441649 * FASTCALL for sorted, next, and getattr refer python/cpython@5a60ecaa7a refer python/cpython@fda6d0acf0 refer python/cpython@84b388bb80 * Optimize methoddescr_call refer python/cpython@2a1b676d1f refer python/cpython@c52572319c refer python/cpython@35ecebe165 refer python/cpython@8128d5a491 * cleanup _PyMethodDef_RawFastCallDict refer python/cpython@0a2e46835d refer python/cpython@98ccba8344 refer python/cpython@c89ef828cf refer python/cpython@250e4b0063 * print now uses METH_FASTCALL refer python/cpython@c3858bd7c6 refer python/cpython@bd584f169f refer python/cpython@06d34393c2 * _struct module now uses Argument Clinic refer python/cpython@3f2d10132d * make deque methods faster refer python/cpython@dd407d5006 * recursive calls in PyObject_Call refer python/cpython@7399a05965 only partially ported, because RawFastCallKeywords hasn't been ported * add macros refer python/cpython@68a001dd59 * all tests pass in MODE=dbg * convert some internal functions to FASTCALL __import__ might need to be changed later, if it is possible to backport the METH_FASTCALL | METH_KEYWORDS flag distinction later. * speed up unpickling refer python/cpython@bee09aecc2 * added _PyMethodDef_RawFastCallKeywords refer python/cpython@7399a05965 * PyCFunction_Call performance refer python/cpython@12c5838dae * avoid PyMethodObject in slots main change in python/cpython@516b98161a test_exceptions changed in python/cpython@331bbe6aaa type_settattro changed in python/cpython@193f7e094f _PyObject_CallFunctionVa changed in python/cpython@fe4ff83049 * fix refcount error found in MODE=dbg all tests now pass in MODE=dbg
This commit is contained in:
parent
6f658f058b
commit
7fe9e70117
71 changed files with 4154 additions and 2450 deletions
485
third_party/python/Python/clinic/import.inc
vendored
485
third_party/python/Python/clinic/import.inc
vendored
|
@ -1,348 +1,373 @@
|
|||
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│
|
||||
│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│
|
||||
╞══════════════════════════════════════════════════════════════════════════════╡
|
||||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "third_party/python/Include/pymacro.h"
|
||||
|
||||
/* clang-format off */
|
||||
/*[clinic input]
|
||||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
PyDoc_STRVAR(_imp_lock_held__doc__,
|
||||
"lock_held($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return True if the import lock is currently held, else False.\n"
|
||||
"\n"
|
||||
"On platforms without threads, return False.");
|
||||
"lock_held($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return True if the import lock is currently held, else False.\n"
|
||||
"\n"
|
||||
"On platforms without threads, return False.");
|
||||
|
||||
#define _IMP_LOCK_HELD_METHODDEF \
|
||||
{"lock_held", (PyCFunction)_imp_lock_held, METH_NOARGS, \
|
||||
_imp_lock_held__doc__},
|
||||
#define _IMP_LOCK_HELD_METHODDEF \
|
||||
{"lock_held", (PyCFunction)_imp_lock_held, METH_NOARGS, _imp_lock_held__doc__},
|
||||
|
||||
static PyObject *_imp_lock_held_impl(PyObject *module);
|
||||
static PyObject *
|
||||
_imp_lock_held_impl(PyObject *module);
|
||||
|
||||
static PyObject *_imp_lock_held(PyObject *module,
|
||||
PyObject *Py_UNUSED(ignored)) {
|
||||
return _imp_lock_held_impl(module);
|
||||
static PyObject *
|
||||
_imp_lock_held(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _imp_lock_held_impl(module);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(
|
||||
_imp_acquire_lock__doc__,
|
||||
"acquire_lock($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Acquires the interpreter\'s import lock for the current thread.\n"
|
||||
"\n"
|
||||
"This lock should be used by import hooks to ensure thread-safety when "
|
||||
"importing\n"
|
||||
"modules. On platforms without threads, this function does nothing.");
|
||||
PyDoc_STRVAR(_imp_acquire_lock__doc__,
|
||||
"acquire_lock($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Acquires the interpreter\'s import lock for the current thread.\n"
|
||||
"\n"
|
||||
"This lock should be used by import hooks to ensure thread-safety when importing\n"
|
||||
"modules. On platforms without threads, this function does nothing.");
|
||||
|
||||
#define _IMP_ACQUIRE_LOCK_METHODDEF \
|
||||
{"acquire_lock", (PyCFunction)_imp_acquire_lock, METH_NOARGS, \
|
||||
_imp_acquire_lock__doc__},
|
||||
#define _IMP_ACQUIRE_LOCK_METHODDEF \
|
||||
{"acquire_lock", (PyCFunction)_imp_acquire_lock, METH_NOARGS, _imp_acquire_lock__doc__},
|
||||
|
||||
static PyObject *_imp_acquire_lock_impl(PyObject *module);
|
||||
static PyObject *
|
||||
_imp_acquire_lock_impl(PyObject *module);
|
||||
|
||||
static PyObject *_imp_acquire_lock(PyObject *module,
|
||||
PyObject *Py_UNUSED(ignored)) {
|
||||
return _imp_acquire_lock_impl(module);
|
||||
static PyObject *
|
||||
_imp_acquire_lock(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _imp_acquire_lock_impl(module);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_imp_release_lock__doc__,
|
||||
"release_lock($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Release the interpreter\'s import lock.\n"
|
||||
"\n"
|
||||
"On platforms without threads, this function does nothing.");
|
||||
"release_lock($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Release the interpreter\'s import lock.\n"
|
||||
"\n"
|
||||
"On platforms without threads, this function does nothing.");
|
||||
|
||||
#define _IMP_RELEASE_LOCK_METHODDEF \
|
||||
{"release_lock", (PyCFunction)_imp_release_lock, METH_NOARGS, \
|
||||
_imp_release_lock__doc__},
|
||||
#define _IMP_RELEASE_LOCK_METHODDEF \
|
||||
{"release_lock", (PyCFunction)_imp_release_lock, METH_NOARGS, _imp_release_lock__doc__},
|
||||
|
||||
static PyObject *_imp_release_lock_impl(PyObject *module);
|
||||
static PyObject *
|
||||
_imp_release_lock_impl(PyObject *module);
|
||||
|
||||
static PyObject *_imp_release_lock(PyObject *module,
|
||||
PyObject *Py_UNUSED(ignored)) {
|
||||
return _imp_release_lock_impl(module);
|
||||
static PyObject *
|
||||
_imp_release_lock(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _imp_release_lock_impl(module);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_imp__fix_co_filename__doc__,
|
||||
"_fix_co_filename($module, code, path, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Changes code.co_filename to specify the passed-in file path.\n"
|
||||
"\n"
|
||||
" code\n"
|
||||
" Code object to change.\n"
|
||||
" path\n"
|
||||
" File path to use.");
|
||||
"_fix_co_filename($module, code, path, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Changes code.co_filename to specify the passed-in file path.\n"
|
||||
"\n"
|
||||
" code\n"
|
||||
" Code object to change.\n"
|
||||
" path\n"
|
||||
" File path to use.");
|
||||
|
||||
#define _IMP__FIX_CO_FILENAME_METHODDEF \
|
||||
{"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_VARARGS, \
|
||||
_imp__fix_co_filename__doc__},
|
||||
#define _IMP__FIX_CO_FILENAME_METHODDEF \
|
||||
{"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__},
|
||||
|
||||
static PyObject *_imp__fix_co_filename_impl(PyObject *module,
|
||||
PyCodeObject *code, PyObject *path);
|
||||
static PyObject *
|
||||
_imp__fix_co_filename_impl(PyObject *module, PyCodeObject *code,
|
||||
PyObject *path);
|
||||
|
||||
static PyObject *_imp__fix_co_filename(PyObject *module, PyObject *args) {
|
||||
PyObject *return_value = NULL;
|
||||
PyCodeObject *code;
|
||||
PyObject *path;
|
||||
static PyObject *
|
||||
_imp__fix_co_filename(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyCodeObject *code;
|
||||
PyObject *path;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O!U:_fix_co_filename", &PyCode_Type, &code,
|
||||
&path)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp__fix_co_filename_impl(module, code, path);
|
||||
if (!_PyArg_ParseStack(args, nargs, "O!U:_fix_co_filename",
|
||||
&PyCode_Type, &code, &path)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("_fix_co_filename", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp__fix_co_filename_impl(module, code, path);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_imp_create_builtin__doc__, "create_builtin($module, spec, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create an extension module.");
|
||||
PyDoc_STRVAR(_imp_create_builtin__doc__,
|
||||
"create_builtin($module, spec, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create an extension module.");
|
||||
|
||||
#define _IMP_CREATE_BUILTIN_METHODDEF \
|
||||
{"create_builtin", (PyCFunction)_imp_create_builtin, METH_O, \
|
||||
_imp_create_builtin__doc__},
|
||||
#define _IMP_CREATE_BUILTIN_METHODDEF \
|
||||
{"create_builtin", (PyCFunction)_imp_create_builtin, METH_O, _imp_create_builtin__doc__},
|
||||
|
||||
PyDoc_STRVAR(
|
||||
_imp_extension_suffixes__doc__,
|
||||
"extension_suffixes($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the list of file suffixes used to identify extension modules.");
|
||||
PyDoc_STRVAR(_imp_extension_suffixes__doc__,
|
||||
"extension_suffixes($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns the list of file suffixes used to identify extension modules.");
|
||||
|
||||
#define _IMP_EXTENSION_SUFFIXES_METHODDEF \
|
||||
{"extension_suffixes", (PyCFunction)_imp_extension_suffixes, METH_NOARGS, \
|
||||
_imp_extension_suffixes__doc__},
|
||||
#define _IMP_EXTENSION_SUFFIXES_METHODDEF \
|
||||
{"extension_suffixes", (PyCFunction)_imp_extension_suffixes, METH_NOARGS, _imp_extension_suffixes__doc__},
|
||||
|
||||
static PyObject *_imp_extension_suffixes_impl(PyObject *module);
|
||||
static PyObject *
|
||||
_imp_extension_suffixes_impl(PyObject *module);
|
||||
|
||||
static PyObject *_imp_extension_suffixes(PyObject *module,
|
||||
PyObject *Py_UNUSED(ignored)) {
|
||||
return _imp_extension_suffixes_impl(module);
|
||||
static PyObject *
|
||||
_imp_extension_suffixes(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _imp_extension_suffixes_impl(module);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_imp_init_frozen__doc__, "init_frozen($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Initializes a frozen module.");
|
||||
PyDoc_STRVAR(_imp_init_frozen__doc__,
|
||||
"init_frozen($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Initializes a frozen module.");
|
||||
|
||||
#define _IMP_INIT_FROZEN_METHODDEF \
|
||||
{"init_frozen", (PyCFunction)_imp_init_frozen, METH_O, \
|
||||
_imp_init_frozen__doc__},
|
||||
#define _IMP_INIT_FROZEN_METHODDEF \
|
||||
{"init_frozen", (PyCFunction)_imp_init_frozen, METH_O, _imp_init_frozen__doc__},
|
||||
|
||||
static PyObject *_imp_init_frozen_impl(PyObject *module, PyObject *name);
|
||||
static PyObject *
|
||||
_imp_init_frozen_impl(PyObject *module, PyObject *name);
|
||||
|
||||
static PyObject *_imp_init_frozen(PyObject *module, PyObject *arg) {
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
static PyObject *
|
||||
_imp_init_frozen(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:init_frozen", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_init_frozen_impl(module, name);
|
||||
if (!PyArg_Parse(arg, "U:init_frozen", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_init_frozen_impl(module, name);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_imp_get_frozen_object__doc__,
|
||||
"get_frozen_object($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create a code object for a frozen module.");
|
||||
"get_frozen_object($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create a code object for a frozen module.");
|
||||
|
||||
#define _IMP_GET_FROZEN_OBJECT_METHODDEF \
|
||||
{"get_frozen_object", (PyCFunction)_imp_get_frozen_object, METH_O, \
|
||||
_imp_get_frozen_object__doc__},
|
||||
#define _IMP_GET_FROZEN_OBJECT_METHODDEF \
|
||||
{"get_frozen_object", (PyCFunction)_imp_get_frozen_object, METH_O, _imp_get_frozen_object__doc__},
|
||||
|
||||
static PyObject *_imp_get_frozen_object_impl(PyObject *module, PyObject *name);
|
||||
static PyObject *
|
||||
_imp_get_frozen_object_impl(PyObject *module, PyObject *name);
|
||||
|
||||
static PyObject *_imp_get_frozen_object(PyObject *module, PyObject *arg) {
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
static PyObject *
|
||||
_imp_get_frozen_object(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:get_frozen_object", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_get_frozen_object_impl(module, name);
|
||||
if (!PyArg_Parse(arg, "U:get_frozen_object", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_get_frozen_object_impl(module, name);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_imp_is_frozen_package__doc__,
|
||||
"is_frozen_package($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns True if the module name is of a frozen package.");
|
||||
"is_frozen_package($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns True if the module name is of a frozen package.");
|
||||
|
||||
#define _IMP_IS_FROZEN_PACKAGE_METHODDEF \
|
||||
{"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_O, \
|
||||
_imp_is_frozen_package__doc__},
|
||||
#define _IMP_IS_FROZEN_PACKAGE_METHODDEF \
|
||||
{"is_frozen_package", (PyCFunction)_imp_is_frozen_package, METH_O, _imp_is_frozen_package__doc__},
|
||||
|
||||
static PyObject *_imp_is_frozen_package_impl(PyObject *module, PyObject *name);
|
||||
static PyObject *
|
||||
_imp_is_frozen_package_impl(PyObject *module, PyObject *name);
|
||||
|
||||
static PyObject *_imp_is_frozen_package(PyObject *module, PyObject *arg) {
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
static PyObject *
|
||||
_imp_is_frozen_package(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:is_frozen_package", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_is_frozen_package_impl(module, name);
|
||||
if (!PyArg_Parse(arg, "U:is_frozen_package", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_is_frozen_package_impl(module, name);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(
|
||||
_imp_is_builtin__doc__,
|
||||
"is_builtin($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns True if the module name corresponds to a built-in module.");
|
||||
PyDoc_STRVAR(_imp_is_builtin__doc__,
|
||||
"is_builtin($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns True if the module name corresponds to a built-in module.");
|
||||
|
||||
#define _IMP_IS_BUILTIN_METHODDEF \
|
||||
{"is_builtin", (PyCFunction)_imp_is_builtin, METH_O, _imp_is_builtin__doc__},
|
||||
#define _IMP_IS_BUILTIN_METHODDEF \
|
||||
{"is_builtin", (PyCFunction)_imp_is_builtin, METH_O, _imp_is_builtin__doc__},
|
||||
|
||||
static PyObject *_imp_is_builtin_impl(PyObject *module, PyObject *name);
|
||||
static PyObject *
|
||||
_imp_is_builtin_impl(PyObject *module, PyObject *name);
|
||||
|
||||
static PyObject *_imp_is_builtin(PyObject *module, PyObject *arg) {
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
static PyObject *
|
||||
_imp_is_builtin(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:is_builtin", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_is_builtin_impl(module, name);
|
||||
if (!PyArg_Parse(arg, "U:is_builtin", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_is_builtin_impl(module, name);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(_imp_is_frozen__doc__,
|
||||
"is_frozen($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns True if the module name corresponds to a frozen module.");
|
||||
"is_frozen($module, name, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Returns True if the module name corresponds to a frozen module.");
|
||||
|
||||
#define _IMP_IS_FROZEN_METHODDEF \
|
||||
{"is_frozen", (PyCFunction)_imp_is_frozen, METH_O, _imp_is_frozen__doc__},
|
||||
#define _IMP_IS_FROZEN_METHODDEF \
|
||||
{"is_frozen", (PyCFunction)_imp_is_frozen, METH_O, _imp_is_frozen__doc__},
|
||||
|
||||
static PyObject *_imp_is_frozen_impl(PyObject *module, PyObject *name);
|
||||
static PyObject *
|
||||
_imp_is_frozen_impl(PyObject *module, PyObject *name);
|
||||
|
||||
static PyObject *_imp_is_frozen(PyObject *module, PyObject *arg) {
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
static PyObject *
|
||||
_imp_is_frozen(PyObject *module, PyObject *arg)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:is_frozen", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_is_frozen_impl(module, name);
|
||||
if (!PyArg_Parse(arg, "U:is_frozen", &name)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_is_frozen_impl(module, name);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#if defined(HAVE_DYNAMIC_LOADING)
|
||||
|
||||
PyDoc_STRVAR(_imp_create_dynamic__doc__,
|
||||
"create_dynamic($module, spec, file=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create an extension module.");
|
||||
"create_dynamic($module, spec, file=None, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Create an extension module.");
|
||||
|
||||
#define _IMP_CREATE_DYNAMIC_METHODDEF \
|
||||
{"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_VARARGS, \
|
||||
_imp_create_dynamic__doc__},
|
||||
#define _IMP_CREATE_DYNAMIC_METHODDEF \
|
||||
{"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_FASTCALL, _imp_create_dynamic__doc__},
|
||||
|
||||
static PyObject *_imp_create_dynamic_impl(PyObject *module, PyObject *spec,
|
||||
PyObject *file);
|
||||
static PyObject *
|
||||
_imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file);
|
||||
|
||||
static PyObject *_imp_create_dynamic(PyObject *module, PyObject *args) {
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *spec;
|
||||
PyObject *file = NULL;
|
||||
static PyObject *
|
||||
_imp_create_dynamic(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *spec;
|
||||
PyObject *file = NULL;
|
||||
|
||||
if (!PyArg_UnpackTuple(args, "create_dynamic", 1, 2, &spec, &file)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_create_dynamic_impl(module, spec, file);
|
||||
if (!_PyArg_UnpackStack(args, nargs, "create_dynamic",
|
||||
1, 2,
|
||||
&spec, &file)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("create_dynamic", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = _imp_create_dynamic_impl(module, spec, file);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_DYNAMIC_LOADING) */
|
||||
|
||||
#if defined(HAVE_DYNAMIC_LOADING)
|
||||
|
||||
PyDoc_STRVAR(_imp_exec_dynamic__doc__, "exec_dynamic($module, mod, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Initialize an extension module.");
|
||||
PyDoc_STRVAR(_imp_exec_dynamic__doc__,
|
||||
"exec_dynamic($module, mod, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Initialize an extension module.");
|
||||
|
||||
#define _IMP_EXEC_DYNAMIC_METHODDEF \
|
||||
{"exec_dynamic", (PyCFunction)_imp_exec_dynamic, METH_O, \
|
||||
_imp_exec_dynamic__doc__},
|
||||
#define _IMP_EXEC_DYNAMIC_METHODDEF \
|
||||
{"exec_dynamic", (PyCFunction)_imp_exec_dynamic, METH_O, _imp_exec_dynamic__doc__},
|
||||
|
||||
static int _imp_exec_dynamic_impl(PyObject *module, PyObject *mod);
|
||||
static int
|
||||
_imp_exec_dynamic_impl(PyObject *module, PyObject *mod);
|
||||
|
||||
static PyObject *_imp_exec_dynamic(PyObject *module, PyObject *mod) {
|
||||
PyObject *return_value = NULL;
|
||||
int _return_value;
|
||||
static PyObject *
|
||||
_imp_exec_dynamic(PyObject *module, PyObject *mod)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int _return_value;
|
||||
|
||||
_return_value = _imp_exec_dynamic_impl(module, mod);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
_return_value = _imp_exec_dynamic_impl(module, mod);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_DYNAMIC_LOADING) */
|
||||
|
||||
PyDoc_STRVAR(_imp_exec_builtin__doc__, "exec_builtin($module, mod, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Initialize a built-in module.");
|
||||
PyDoc_STRVAR(_imp_exec_builtin__doc__,
|
||||
"exec_builtin($module, mod, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Initialize a built-in module.");
|
||||
|
||||
#define _IMP_EXEC_BUILTIN_METHODDEF \
|
||||
{"exec_builtin", (PyCFunction)_imp_exec_builtin, METH_O, \
|
||||
_imp_exec_builtin__doc__},
|
||||
#define _IMP_EXEC_BUILTIN_METHODDEF \
|
||||
{"exec_builtin", (PyCFunction)_imp_exec_builtin, METH_O, _imp_exec_builtin__doc__},
|
||||
|
||||
static int _imp_exec_builtin_impl(PyObject *module, PyObject *mod);
|
||||
static int
|
||||
_imp_exec_builtin_impl(PyObject *module, PyObject *mod);
|
||||
|
||||
static PyObject *_imp_exec_builtin(PyObject *module, PyObject *mod) {
|
||||
PyObject *return_value = NULL;
|
||||
int _return_value;
|
||||
static PyObject *
|
||||
_imp_exec_builtin(PyObject *module, PyObject *mod)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int _return_value;
|
||||
|
||||
_return_value = _imp_exec_builtin_impl(module, mod);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
_return_value = _imp_exec_builtin_impl(module, mod);
|
||||
if ((_return_value == -1) && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = PyLong_FromLong((long)_return_value);
|
||||
|
||||
exit:
|
||||
return return_value;
|
||||
return return_value;
|
||||
}
|
||||
|
||||
#ifndef _IMP_CREATE_DYNAMIC_METHODDEF
|
||||
#define _IMP_CREATE_DYNAMIC_METHODDEF
|
||||
#define _IMP_CREATE_DYNAMIC_METHODDEF
|
||||
#endif /* !defined(_IMP_CREATE_DYNAMIC_METHODDEF) */
|
||||
|
||||
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#define _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#define _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
|
||||
/*[clinic end generated code: output=d24d7f73702a907f input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=c1d0e65d04114958 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue