8000 gh-108191: Add support of positional argument in SimpleNamespace constructor by serhiy-storchaka · Pull Request #108195 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-108191: Add support of positional argument in SimpleNamespace constructor #108195

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

Merged
merged 17 commits into from
Apr 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension
8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Polishing.
  • Loading branch information
serhiy-storchaka committed Aug 26, 2023
commit e94e97afd1b0c3cac2fe3138a86fbf7b3802c7cb
7 changes: 2 additions & 5 deletions Objects/namespaceobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ namespace_init(_PyNamespaceObject *ns, PyObject *args, PyObject *kwds)
}
if (arg != NULL) {
PyObject *dict;
int ret = 0;
if (PyDict_CheckExact(arg)) {
dict = Py_NewRef(arg);
}
Expand All @@ -62,12 +61,10 @@ namespace_init(_PyNamespaceObject *ns, PyObject *args, PyObject *kwds)
if (!PyArg_ValidateKeywordArguments(dict) ||
PyDict_Update(ns->ns_dict, dict) < 0)
{
ret = -1;
}
Py_DECREF(dict);
if (ret < 0) {
Py_DECREF(dict);
return -1;
}
Py_DECREF(dict);
}
if (kwds == NULL) {
return 0;
Expand Down
0