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
This commit is contained in:
Miro Hrončok 2021-09-21 11:19:00 +02:00
parent 580511b782
commit 4aa279fd98
2 changed files with 17 additions and 0 deletions

View File

@ -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)

View File

@ -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