1. Ronald Oussoren
  2. pyobjc

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.

  • Participants
  • Parent commits 2b7973f
  • Branches default

Comments (0)

Files changed (1)

File pyobjc-core/Modules/objc/corefoundation.m

View file
  • Ignore whitespace
 		}
 	}
 	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);