Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-31428: Prevent raising a SystemError in case the memo arg of ElementTree.Element.__deepcopy__() isn't a dictionary #3512

Merged
merged 3 commits into from
Sep 12, 2017

Conversation

orenmn
Copy link
Contributor

@orenmn orenmn commented Sep 12, 2017

@@ -750,6 +750,13 @@ _elementtree_Element___deepcopy__(ElementObject *self, PyObject *memo)
PyObject* tail;
PyObject* id;

if (!PyDict_Check(memo)) {
Copy link
Member

@serhiy-storchaka serhiy-storchaka Sep 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just change

    memo: object

to

    memo: object(subclass_of="&PyDict_Type")

@serhiy-storchaka serhiy-storchaka merged commit d056818 into python:master Sep 12, 2017
@miss-islington
Copy link
Contributor

Thanks, @serhiy-storchaka!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants