1 |
commit: 97887768e3f5e8bc1b520b119fde97fed16cfe7d |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Apr 28 22:59:21 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 28 23:05:25 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=97887768 |
7 |
|
8 |
PortageKeyError: fix __unicode__ AttributeError under python2.7 |
9 |
|
10 |
File "pym/portage/exception.py", line 32, in __unicode__ |
11 |
if isinstance(self.value, unicode): |
12 |
AttributeError: 'PortageKeyError' object has no attribute 'value' |
13 |
|
14 |
pym/portage/exception.py | 3 +++ |
15 |
1 file changed, 3 insertions(+) |
16 |
|
17 |
diff --git a/pym/portage/exception.py b/pym/portage/exception.py |
18 |
index 263cdf087..aed8beeb9 100644 |
19 |
--- a/pym/portage/exception.py |
20 |
+++ b/pym/portage/exception.py |
21 |
@@ -44,6 +44,9 @@ class PortageException(Exception): |
22 |
|
23 |
class PortageKeyError(KeyError, PortageException): |
24 |
__doc__ = KeyError.__doc__ |
25 |
+ def __init__(self, value): |
26 |
+ KeyError.__init__(self, value) |
27 |
+ PortageException.__init__(self, value) |
28 |
|
29 |
class CorruptionError(PortageException): |
30 |
"""Corruption indication""" |