From 55fbecae61d64ad751d4efe005714de3e7becaeb Mon Sep 17 00:00:00 2001 From: Radek Novacek Date: Thu, 11 Feb 2016 16:03:40 +0100 Subject: [PATCH] Fix TypeError at shutdown --- 0001-Fix-TypeError-at-shutdown.patch | 29 ++++++++++++++++++++++++++++ python-enchant.spec | 7 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-TypeError-at-shutdown.patch diff --git a/0001-Fix-TypeError-at-shutdown.patch b/0001-Fix-TypeError-at-shutdown.patch new file mode 100644 index 0000000..948e15c --- /dev/null +++ b/0001-Fix-TypeError-at-shutdown.patch @@ -0,0 +1,29 @@ +From ab4930e371ab168b74d8becdac0517c369931a88 Mon Sep 17 00:00:00 2001 +From: six +Date: Sun, 3 May 2015 07:54:40 -0700 +Subject: [PATCH] Fix TypeError at shutdown. + +--- + enchant/__init__.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/enchant/__init__.py b/enchant/__init__.py +index cc77eba..eb8079c 100644 +--- a/enchant/__init__.py ++++ b/enchant/__init__.py +@@ -240,8 +240,11 @@ class Broker(_EnchantObject): + + def __del__(self): + """Broker object destructor.""" +- if _e is not None: ++ # Calling free() might fail if python is shutting down ++ try: + self._free() ++ except (AttributeError, TypeError): ++ pass + + def __getstate__(self): + state = super(Broker,self).__getstate__() +-- +2.5.0 + diff --git a/python-enchant.spec b/python-enchant.spec index 9952c6b..7bb8b52 100644 --- a/python-enchant.spec +++ b/python-enchant.spec @@ -6,13 +6,14 @@ Name: python-enchant Version: 1.6.6 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Python bindings for Enchant spellchecking library Group: Development/Languages License: LGPLv2+ URL: http://packages.python.org/pyenchant/ Source0: http://pypi.python.org/packages/source/p/pyenchant/pyenchant-%{version}.tar.gz +Patch0: 0001-Fix-TypeError-at-shutdown.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -56,6 +57,7 @@ library by Dom Lachowicz. %prep %setup -q -n pyenchant-%{version} +%patch0 -p1 %if 0%{?with_python3} rm -rf %{py3dir} @@ -137,6 +139,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Feb 10 2016 David Shea - 1.6.6-7 +- Fix TypeError at shutdown + * Thu Feb 04 2016 Fedora Release Engineering - 1.6.6-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild