Commits

Ronald Oussoren committed 939a0e7

Ensure code does what it promises

Don't return NULL when typeid is 0, but return
the wrapper for CFTypeRef, as promised by the
comment. Without this we'd return NULL (error state),
without raising a python exception.

Comments (0)

Files changed (1)

pyobjc-core/Modules/objc/corefoundation.m

 		}
 	}
 	if (typeID == 0) {
-		/* Partially registered type, just wrap is a
+		/* Partially registered type, just wrap as a
 		 * a plain CFTypeRef
 		 */
-		return NULL;
+		Py_INCREF(PyObjC_NSCFTypeClass);
+		return PyObjC_NSCFTypeClass;
 	}
 
 	PyObject* cf = PyLong_FromUnsignedLongLong(typeID);