From 4aa279fd98d381c4e7cb46a4c8751d42c3457b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 21 Sep 2021 11:19:00 +0200 Subject: [PATCH] Python: Don't call Py_DECREF(Py_True/Py_False) in register_constants() Avoids a Fatal Python error: bool_dealloc: deallocating True or False Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1900651 --- lasso-python-dont-decref-true-false.patch | 12 ++++++++++++ lasso.spec | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 lasso-python-dont-decref-true-false.patch diff --git a/lasso-python-dont-decref-true-false.patch b/lasso-python-dont-decref-true-false.patch new file mode 100644 index 0000000..23a7f63 --- /dev/null +++ b/lasso-python-dont-decref-true-false.patch @@ -0,0 +1,12 @@ +diff --git a/bindings/python/lang.py b/bindings/python/lang.py +index bd7ef70..644de23 100644 +--- a/bindings/python/lang.py ++++ b/bindings/python/lang.py +@@ -739,7 +739,6 @@ register_constants(PyObject *d) + else: + print_('E: unknown constant type: %r' % c[0], file=sys.stderr) + print_(' PyDict_SetItemString(d, "%s", obj);' % c[1][6:], file=fd) +- print_(' Py_DECREF(obj);', file=fd) + print_('}', file=fd) + print_('', file=fd) + diff --git a/lasso.spec b/lasso.spec index f1d25b4..a895704 100644 --- a/lasso.spec +++ b/lasso.spec @@ -64,6 +64,11 @@ License: GPLv2+ URL: http://lasso.entrouvert.org/ Source: http://dev.entrouvert.org/lasso/lasso-%{version}.tar.gz +# Python: Don't call Py_DECREF(Py_True/Py_False) in register_constants() +# Avoids a Fatal Python error: bool_dealloc: deallocating True or False +# Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1900651 +Patch1: lasso-python-dont-decref-true-false.patch + BuildRequires: autoconf BuildRequires: automake BuildRequires: check-devel