# HG changeset patch # User Steve Streeting # Date 2011-09-08 10:34:59 # Node ID 258eee414ab7664e1509c3bee2e8960585337685 # Parent 106f89299da61291b31dc054de721c98a04a1380 osutil: avoid accidentally destroying the True object in isgui (issue2937) Needed to use 'Py_RETURN_TRUE' instead of 'return Py_True' to avoid reference count errors which would randomly crash the Python executable during merge. This only happened when you had something configured in merge-tools and the merge was large enough. diff --git a/mercurial/osutil.c b/mercurial/osutil.c --- a/mercurial/osutil.c +++ b/mercurial/osutil.c @@ -523,9 +523,9 @@ static PyObject *isgui(PyObject *self) if (dict != NULL) { CFRelease(dict); - return Py_True; + Py_RETURN_TRUE; } else { - return Py_False; + Py_RETURN_FALSE; } } #endif