Commits

Ronald Oussoren committed 546ee9d

Use -getCharacters:range: instead of -getCharacers:

The latter is both deprecated and unsave.

  • Participants
  • Parent commits 0467def

Comments (0)

Files changed (1)

pyobjc-core/Modules/objc/unicode-object.m

 
 #ifdef PyObjC_UNICODE_FAST_PATH
 	Py_ssize_t length = [value length];
+	NSRange range;
 
 	if (length < 0) {
 		PyErr_SetString(PyExc_SystemError, "string with negative length");
 		PyErr_NoMemory();
 		return NULL;
 	}
-	[value getCharacters:(unichar *)PyUnicode_AS_UNICODE(result)];
+	range = NSMakeRange(0, length);
+	[value getCharacters:(unichar *)PyUnicode_AS_UNICODE(result) range:range];
 	/*PyUnicode_GET_SIZE(result) = length;*/
 	result->base.length = length;
 #else