Fix TypeError at shutdown

This commit is contained in:
Radek Novacek 2016-02-11 16:03:40 +01:00
parent 80d9518d52
commit 55fbecae61
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From ab4930e371ab168b74d8becdac0517c369931a88 Mon Sep 17 00:00:00 2001
From: six <brbsix@gmail.com>
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

View File

@ -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 <dshea@redhat.com> - 1.6.6-7
- Fix TypeError at shutdown
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild