Skip to content

Commit d71441e

Browse files
committed
Is func a builtin on ms c compiler? lol
1 parent 9207e08 commit d71441e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/lazy_object_proxy/cext.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,23 +225,27 @@ static PyObject *Proxy_str(ProxyObject *self)
225225
static PyObject *Proxy_fspath(ProxyObject *self)
226226
{
227227
Proxy__ENSURE_WRAPPED_OR_RETURN_NULL(self);
228-
PyObject *func;
229-
PyObject *fspath;
228+
229+
PyObject *method = NULL;
230+
PyObject *fspath = NULL;
230231

231232
if (PyUnicode_Check(self->wrapped) || PyBytes_Check(self->wrapped)) {
232233
Py_INCREF(self->wrapped);
233234
return self->wrapped;
234235
}
235236

236-
func = PyObject_GetAttrString(self->wrapped, "__fspath__");
237-
if (func == NULL) {
237+
method = PyObject_GetAttrString(self->wrapped, "__fspath__");
238+
239+
if (!method) {
238240
PyErr_Clear();
239241
Py_INCREF(self->wrapped);
240242
return self->wrapped;
241243
}
242244

243-
fspath = PyObject_CallFunctionObjArgs(func, NULL);
244-
Py_DECREF(func);
245+
fspath = PyObject_CallFunctionObjArgs(method, NULL);
246+
247+
Py_DECREF(method);
248+
245249
return fspath;
246250
}
247251

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy