Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

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
Use PyDict_GetItemRef instead of PyDict_GetItemWithError
  • Loading branch information
skirpichev committed Aug 22, 2023
commit 7fe6a06aa2070886958e8c596fdcb5df74280fca
25 changes: 14 additions & 11 deletions Objects/moduleobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,28 +869,31 @@ _Py_module_getattro(PyModuleObject *m, PyObject *name)
static int
module_setattro(PyModuleObject *mod, PyObject *name, PyObject *value)
{
PyObject *ret;
PyObject *res;
Comment thread
skirpichev marked this conversation as resolved.
Resolved
int ret;
assert(mod->md_dict != NULL);
if (value == NULL) {
Comment thread
skirpichev marked this conversation as resolved.
Resolved
PyObject *delattr = PyDict_GetItemWithError(mod->md_dict, &_Py_ID(__delattr__));
if (PyErr_Occurred()) {
PyObject *delattr;
ret = PyDict_GetItemRef(mod->md_dict, &_Py_ID(__delattr__), &delattr);
if (ret == -1) {
return -1;
}
if (delattr) {
ret = PyObject_CallFunctionObjArgs(delattr, name, NULL);
if (ret == NULL) {
if (ret) {
res = PyObject_CallFunctionObjArgs(delattr, name, NULL);
Comment thread
skirpichev marked this conversation as resolved.
Resolved
if (res == NULL) {
return -1;
}
Comment thread
skirpichev marked this conversation as resolved.
Resolved
return 0;
}
} else {
Comment thread
skirpichev marked this conversation as resolved.
Resolved
PyObject *setattr = PyDict_GetItemWithError(mod->md_dict, &_Py_ID(__setattr__));
if (PyErr_Occurred()) {
PyObject *setattr;
ret = PyDict_GetItemRef(mod->md_dict, &_Py_ID(__setattr__), &setattr);
if (ret == -1) {
return -1;
}
if (setattr) {
ret = PyObject_CallFunctionObjArgs(setattr, name, value, NULL);
if (ret == NULL) {
if (ret) {
res = PyObject_CallFunctionObjArgs(setattr, name, value, NULL);
if (res == NULL) {
return -1;
}
return 0;
Expand Down