|
2 | 2 | preserve
|
3 | 3 | [clinic start generated code]*/
|
4 | 4 |
|
5 |
| -#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) |
6 |
| -# include "pycore_gc.h" // PyGC_Head |
7 |
| -# include "pycore_runtime.h" // _Py_ID() |
8 |
| -#endif |
9 |
| - |
| 5 | +#include "pycore_modsupport.h" // _PyArg_CheckPositional() |
10 | 6 |
|
11 | 7 | PyDoc_STRVAR(readline_parse_and_bind__doc__,
|
12 | 8 | "parse_and_bind($module, string, /)\n"
|
@@ -146,7 +142,7 @@ readline_append_history_file(PyObject *module, PyObject *const *args, Py_ssize_t
|
146 | 142 | if (!_PyArg_CheckPositional("append_history_file", nargs, 1, 2)) {
|
147 | 143 | goto exit;
|
148 | 144 | }
|
149 |
| - nelements = _PyLong_AsInt(args[0]); |
| 145 | + nelements = PyLong_AsInt(args[0]); |
150 | 146 | if (nelements == -1 && PyErr_Occurred()) {
|
151 | 147 | goto exit;
|
152 | 148 | }
|
@@ -183,7 +179,7 @@ readline_set_history_length(PyObject *module, PyObject *arg)
|
183 | 179 | PyObject *return_value = NULL;
|
184 | 180 | int length;
|
185 | 181 |
|
186 |
| - length = _PyLong_AsInt(arg); |
| 182 | + length = PyLong_AsInt(arg); |
187 | 183 | if (length == -1 && PyErr_Occurred()) {
|
188 | 184 | goto exit;
|
189 | 185 | }
|
@@ -404,7 +400,7 @@ readline_remove_history_item(PyObject *module, PyObject *arg)
|
404 | 400 | PyObject *return_value = NULL;
|
405 | 401 | int entry_number;
|
406 | 402 |
|
407 |
| - entry_number = _PyLong_AsInt(arg); |
| 403 | + entry_number = PyLong_AsInt(arg); |
408 | 404 | if (entry_number == -1 && PyErr_Occurred()) {
|
409 | 405 | goto exit;
|
410 | 406 | }
|
@@ -439,17 +435,14 @@ readline_replace_history_item(PyObject *module, PyObject *const *args, Py_ssize_
|
439 | 435 | if (!_PyArg_CheckPositional("replace_history_item", nargs, 2, 2)) {
|
440 | 436 | goto exit;
|
441 | 437 | }
|
442 |
| - entry_number = _PyLong_AsInt(args[0]); |
| 438 | + entry_number = PyLong_AsInt(args[0]); |
443 | 439 | if (entry_number == -1 && PyErr_Occurred()) {
|
444 | 440 | goto exit;
|
445 | 441 | }
|
446 | 442 | if (!PyUnicode_Check(args[1])) {
|
447 | 443 | _PyArg_BadArgument("replace_history_item", "argument 2", "str", args[1]);
|
448 | 444 | goto exit;
|
449 | 445 | }
|
450 |
| - if (PyUnicode_READY(args[1]) == -1) { |
451 |
| - goto exit; |
452 |
| - } |
453 | 446 | line = args[1];
|
454 | 447 | return_value = readline_replace_history_item_impl(module, entry_number, line);
|
455 | 448 |
|
@@ -585,7 +578,7 @@ readline_get_history_item(PyObject *module, PyObject *arg)
|
585 | 578 | PyObject *return_value = NULL;
|
586 | 579 | int idx;
|
587 | 580 |
|
588 |
| - idx = _PyLong_AsInt(arg); |
| 581 | + idx = PyLong_AsInt(arg); |
589 | 582 | if (idx == -1 && PyErr_Occurred()) {
|
590 | 583 | goto exit;
|
591 | 584 | }
|
@@ -691,4 +684,4 @@ readline_redisplay(PyObject *module, PyObject *Py_UNUSED(ignored))
|
691 | 684 | #ifndef READLINE_CLEAR_HISTORY_METHODDEF
|
692 | 685 | #define READLINE_CLEAR_HISTORY_METHODDEF
|
693 | 686 | #endif /* !defined(READLINE_CLEAR_HISTORY_METHODDEF) */
|
694 |
| -/*[clinic end generated code: output=9097fcb749c19e27 input=a9049054013a1b77]*/ |
| 687 | +/*[clinic end generated code: output=358ab465285c7949 input=a9049054013a1b77]*/ |
0 commit comments