Skip to content

Commit 452ef1e

Browse files
committed
Remove some dead code. __wrapped__/__factory__ are always going to be on the type object (thus get caught in the following check against the type).
1 parent a68627c commit 452ef1e

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/lazy_object_proxy/cext.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,29 +1109,6 @@ static int Proxy_setattro(
11091109
ProxyObject *self, PyObject *name, PyObject *value)
11101110
{
11111111
static PyObject *self_str = NULL;
1112-
static PyObject *wrapped_str = NULL;
1113-
static PyObject *startswith_str = NULL;
1114-
1115-
PyObject *match = NULL;
1116-
1117-
if (!startswith_str) {
1118-
#if PY_MAJOR_VERSION >= 3
1119-
startswith_str = PyUnicode_InternFromString("startswith");
1120-
#else
1121-
startswith_str = PyString_InternFromString("startswith");
1122-
#endif
1123-
}
1124-
1125-
if (!wrapped_str) {
1126-
#if PY_MAJOR_VERSION >= 3
1127-
wrapped_str = PyUnicode_InternFromString("__wrapped__");
1128-
#else
1129-
wrapped_str = PyString_InternFromString("__wrapped__");
1130-
#endif
1131-
}
1132-
1133-
if (PyObject_RichCompareBool(name, wrapped_str, Py_EQ) == 1)
1134-
return PyObject_GenericSetAttr((PyObject *)self, name, value);
11351112

11361113
if (PyObject_HasAttr((PyObject *)Py_TYPE(self), name))
11371114
return PyObject_GenericSetAttr((PyObject *)self, name, value);

0 commit comments

Comments
 (0)