We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 481cf59 commit 96b4dd1Copy full SHA for 96b4dd1
Modules/_ctypes/callproc.c
@@ -1993,13 +1993,14 @@ create_pointer_type(PyObject *module, PyObject *cls)
1993
1994
assert(module);
1995
ctypes_state *st = get_module_state(module);
1996
- StgInfo* info = NULL;
1997
- if (PyStgInfo_FromAny(st, cls, &info) < 0) {
1998
- return NULL;
1999
- }
2000
-
2001
- if (info && info->pointer_type) {
2002
- return Py_XNewRef(info->pointer_type);
+ StgInfo *info = NULL;
+ if (PyType_Check(cls)) {
+ if (PyStgInfo_FromType(st, cls, &info) < 0) {
+ return NULL;
+ }
+ if (info && info->pointer_type) {
+ return Py_NewRef(info->pointer_type);
2003
2004
}
2005
2006
if (PyDict_GetItemRef(st->_ctypes_ptrtype_cache, cls, &result) != 0) {
0 commit comments