summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorShantanu <hauntsaninja@users.noreply.github.com>2020-03-02 06:33:24 (GMT)
committerGitHub <noreply@github.com>2020-03-02 06:33:24 (GMT)
commit4edc95cf0a2960431621eee9bc194f6225f1690b (patch)
tree797be15086532d032931aa450b9f511dbbdb78b6 /Modules
parent1f577ce363121d590b51abf5c41d1bcf3d751436 (diff)
downloadcpython-4edc95cf0a2960431621eee9bc194f6225f1690b.zip
cpython-4edc95cf0a2960431621eee9bc194f6225f1690b.tar.gz
cpython-4edc95cf0a2960431621eee9bc194f6225f1690b.tar.bz2
bpo-39495: Remove default value from C impl of TreeBuilder.start (GH-18275)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_elementtree.c4
-rw-r--r--Modules/clinic/_elementtree.c.h14
2 files changed, 9 insertions, 9 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 4498c5f..c0f771f 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -3038,7 +3038,7 @@ _elementtree_TreeBuilder_close_impl(TreeBuilderObject *self)
_elementtree.TreeBuilder.start
tag: object
- attrs: object = None
+ attrs: object(subclass_of='&PyDict_Type')
/
[clinic start generated code]*/
@@ -3046,7 +3046,7 @@ _elementtree.TreeBuilder.start
static PyObject *
_elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag,
PyObject *attrs)
-/*[clinic end generated code: output=e7e9dc2861349411 input=95fc1758dd042c65]*/
+/*[clinic end generated code: output=e7e9dc2861349411 input=7288e9e38e63b2b6]*/
{
return treebuilder_handle_start(self, tag, attrs);
}
diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h
index a184b0f..dae5233 100644
--- a/Modules/clinic/_elementtree.c.h
+++ b/Modules/clinic/_elementtree.c.h
@@ -761,7 +761,7 @@ _elementtree_TreeBuilder_close(TreeBuilderObject *self, PyObject *Py_UNUSED(igno
}
PyDoc_STRVAR(_elementtree_TreeBuilder_start__doc__,
-"start($self, tag, attrs=None, /)\n"
+"start($self, tag, attrs, /)\n"
"--\n"
"\n");
@@ -777,17 +777,17 @@ _elementtree_TreeBuilder_start(TreeBuilderObject *self, PyObject *const *args, P
{
PyObject *return_value = NULL;
PyObject *tag;
- PyObject *attrs = Py_None;
+ PyObject *attrs;
- if (!_PyArg_CheckPositional("start", nargs, 1, 2)) {
+ if (!_PyArg_CheckPositional("start", nargs, 2, 2)) {
goto exit;
}
tag = args[0];
- if (nargs < 2) {
- goto skip_optional;
+ if (!PyDict_Check(args[1])) {
+ _PyArg_BadArgument("start", "argument 2", "dict", args[1]);
+ goto exit;
}
attrs = args[1];
-skip_optional:
return_value = _elementtree_TreeBuilder_start_impl(self, tag, attrs);
exit:
@@ -916,4 +916,4 @@ skip_optional:
exit:
return return_value;
}
-/*[clinic end generated code: output=bee26d0735a3fddc input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3ad029ba71f5ae39 input=a9049054013a1b77]*/