Fix crash on Catalina. https://github.com/ronaldoussoren/pyobjc/issues/265 https://github.com/ronaldoussoren/pyobjc/commit/8c97708502f486e1e5fc43a5252e61f9ab282650 https://github.com/ronaldoussoren/pyobjc/commit/76b4bb2d76d33961821c6cc0d88c7031c62805c2 --- Modules/objc/method-signature.m.orig 2019-10-16 04:40:21.000000000 -0500 +++ Modules/objc/method-signature.m 2020-08-29 03:48:31.000000000 -0500 @@ -628,10 +628,16 @@ #endif if (d && PyObject_IsTrue(d)) { if (descr == NULL || (descr->tmpl && !descr->alreadyRetained)) return -2; - descr->alreadyRetained = YES; + // descr may be loaded into read-only memory, so only + // write if truly necessary + if (!descr->alreadyRetained) + descr->alreadyRetained = YES; } else { if (descr == NULL || (descr->tmpl && descr->alreadyRetained)) return -2; - descr->alreadyRetained = NO; + // descr may be loaded into read-only memory, so only + // write if truly necessary + if (descr->alreadyRetained) + descr->alreadyRetained = NO; } }