Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b049325

Browse files
committed
Use symbolic METH_VARARGS/METH_OLDARGS instead of 1/0 for ml_flags
1 parent 031829d commit b049325

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

Modules/_sre.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,8 +2938,8 @@ scanner_search(ScannerObject* self, PyObject* args)
29382938
}
29392939

29402940
static PyMethodDef scanner_methods[] = {
2941-
{"match", (PyCFunction) scanner_match, 0},
2942-
{"search", (PyCFunction) scanner_search, 0},
2941+
{"match", (PyCFunction) scanner_match, METH_OLDARGS},
2942+
{"search", (PyCFunction) scanner_search, METH_OLDARGS},
29432943
{NULL, NULL}
29442944
};
29452945

@@ -2974,9 +2974,9 @@ statichere PyTypeObject Scanner_Type = {
29742974
};
29752975

29762976
static PyMethodDef _functions[] = {
2977-
{"compile", _compile, 1},
2978-
{"getcodesize", sre_codesize, 1},
2979-
{"getlower", sre_getlower, 1},
2977+
{"compile", _compile, METH_VARARGS},
2978+
{"getcodesize", sre_codesize, METH_VARARGS},
2979+
{"getlower", sre_getlower, METH_VARARGS},
29802980
{NULL, NULL}
29812981
};
29822982

Modules/_tkinter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ Tktt_DeleteTimerHandler(PyObject *self, PyObject *args)
15461546

15471547
static PyMethodDef Tktt_methods[] =
15481548
{
1549-
{"deletetimerhandler", Tktt_DeleteTimerHandler, 1},
1549+
{"deletetimerhandler", Tktt_DeleteTimerHandler, METH_VARARGS},
15501550
{NULL, NULL}
15511551
};
15521552

Modules/cPickle.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,13 +2259,13 @@ Pickler_dump(Picklerobject *self, PyObject *args) {
22592259

22602260

22612261
static struct PyMethodDef Pickler_methods[] = {
2262-
{"dump", (PyCFunction)Pickler_dump, 1,
2262+
{"dump", (PyCFunction)Pickler_dump, METH_VARARGS,
22632263
"dump(object) --"
22642264
"Write an object in pickle format to the object's pickle stream\n"
22652265
},
2266-
{"clear_memo", (PyCFunction)Pickle_clear_memo, 1,
2266+
{"clear_memo", (PyCFunction)Pickle_clear_memo, METH_VARARGS,
22672267
"clear_memo() -- Clear the picklers memo"},
2268-
{"getvalue", (PyCFunction)Pickle_getvalue, 1,
2268+
{"getvalue", (PyCFunction)Pickle_getvalue, METH_VARARGS,
22692269
"getvalue() -- Finish picking a list-based pickle"},
22702270
{NULL, NULL} /* sentinel */
22712271
};
@@ -4179,10 +4179,10 @@ Unpickler_noload(Unpicklerobject *self, PyObject *args) {
41794179

41804180

41814181
static struct PyMethodDef Unpickler_methods[] = {
4182-
{"load", (PyCFunction)Unpickler_load, 1,
4182+
{"load", (PyCFunction)Unpickler_load, METH_VARARGS,
41834183
"load() -- Load a pickle"
41844184
},
4185-
{"noload", (PyCFunction)Unpickler_noload, 1,
4185+
{"noload", (PyCFunction)Unpickler_noload, METH_VARARGS,
41864186
"noload() -- not load a pickle, but go through most of the motions\n"
41874187
"\n"
41884188
"This function can be used to read past a pickle without instantiating\n"
@@ -4513,34 +4513,34 @@ static PyTypeObject Unpicklertype = {
45134513
};
45144514

45154515
static struct PyMethodDef cPickle_methods[] = {
4516-
{"dump", (PyCFunction)cpm_dump, 1,
4516+
{"dump", (PyCFunction)cpm_dump, METH_VARARGS,
45174517
"dump(object, file, [binary]) --"
45184518
"Write an object in pickle format to the given file\n"
45194519
"\n"
45204520
"If the optional argument, binary, is provided and is true, then the\n"
45214521
"pickle will be written in binary format, which is more space and\n"
45224522
"computationally efficient. \n"
45234523
},
4524-
{"dumps", (PyCFunction)cpm_dumps, 1,
4524+
{"dumps", (PyCFunction)cpm_dumps, METH_VARARGS,
45254525
"dumps(object, [binary]) --"
45264526
"Return a string containing an object in pickle format\n"
45274527
"\n"
45284528
"If the optional argument, binary, is provided and is true, then the\n"
45294529
"pickle will be written in binary format, which is more space and\n"
45304530
"computationally efficient. \n"
45314531
},
4532-
{"load", (PyCFunction)cpm_load, 1,
4532+
{"load", (PyCFunction)cpm_load, METH_VARARGS,
45334533
"load(file) -- Load a pickle from the given file"},
4534-
{"loads", (PyCFunction)cpm_loads, 1,
4534+
{"loads", (PyCFunction)cpm_loads, METH_VARARGS,
45354535
"loads(string) -- Load a pickle from the given string"},
4536-
{"Pickler", (PyCFunction)get_Pickler, 1,
4536+
{"Pickler", (PyCFunction)get_Pickler, METH_VARARGS,
45374537
"Pickler(file, [binary]) -- Create a pickler\n"
45384538
"\n"
45394539
"If the optional argument, binary, is provided and is true, then\n"
45404540
"pickles will be written in binary format, which is more space and\n"
45414541
"computationally efficient. \n"
45424542
},
4543-
{"Unpickler", (PyCFunction)get_Unpickler, 1,
4543+
{"Unpickler", (PyCFunction)get_Unpickler, METH_VARARGS,
45444544
"Unpickler(file) -- Create an unpickler"},
45454545
{ NULL, NULL }
45464546
};

0 commit comments

Comments
 (0)