- Handle RuntimeError when localizing state reason (bug #543937).

This commit is contained in:
Tim Waugh 2009-12-03 14:59:37 +00:00
parent b8c3456e9f
commit 784addac2c
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff -up system-config-printer-1.1.15/statereason.py.localize-statereason system-config-printer-1.1.15/statereason.py
--- system-config-printer-1.1.15/statereason.py.localize-statereason 2009-11-30 12:43:08.000000000 +0000
+++ system-config-printer-1.1.15/statereason.py 2009-12-03 14:57:17.285051607 +0000
@@ -138,7 +138,7 @@ class StateReason:
reason = localized_reason[:-2]
else:
reason = self.get_reason()
- except cups.IPPError:
+ except (cups.IPPError, RuntimeError):
reason = self.get_reason()
text = _("Printer '%s': '%s'.") % (self.get_printer (), reason)

View File

@ -7,7 +7,7 @@
Summary: A printer administration tool Summary: A printer administration tool
Name: system-config-printer Name: system-config-printer
Version: 1.1.15 Version: 1.1.15
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv2+ License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/ URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base Group: System Environment/Base
@ -16,6 +16,7 @@ Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
Patch1: system-config-printer-no-epydoc.patch Patch1: system-config-printer-no-epydoc.patch
Patch2: system-config-printer-localize-statereason.patch
BuildRequires: cups-devel >= 1.2 BuildRequires: cups-devel >= 1.2
BuildRequires: python-devel >= 2.4 BuildRequires: python-devel >= 2.4
@ -76,6 +77,7 @@ printers.
%prep %prep
%setup -q -a 1 -a 2 %setup -q -a 1 -a 2
%patch1 -p1 -b .no-epydoc %patch1 -p1 -b .no-epydoc
%patch2 -p1 -b .localize-statereason
%build %build
%configure --with-udev-rules --with-polkit-1 %configure --with-udev-rules --with-polkit-1
@ -188,6 +190,9 @@ rm -rf %buildroot
exit 0 exit 0
%changelog %changelog
* Thu Dec 3 2009 Tim Waugh <twaugh@redhat.com> - 1.1.15-2
- Handle RuntimeError when localizing state reason (bug #543937).
* Mon Nov 30 2009 Tim Waugh <twaugh@redhat.com> 1.1.15-1 * Mon Nov 30 2009 Tim Waugh <twaugh@redhat.com> 1.1.15-1
- 1.1.15: - 1.1.15:
- Fixed traceback introduced by fix to bug #541882. - Fixed traceback introduced by fix to bug #541882.