[yum-commits] Branch 'yum-3_2_X' - yum/sqlitesack.py
James Antill
james at osuosl.org
Sun Dec 7 18:35:16 UTC 2008
yum/sqlitesack.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 2310e48492bca17a9439d0ea834d9e0dd9caf049
Author: James Antill <james at and.org>
Date: Sun Dec 7 02:22:23 2008 -0500
Fix the e.message warnings from 2.6.x
diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
index 76c9a41..21fec5a 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
@@ -35,6 +35,7 @@ import constants
import operator
import time
from yum.misc import seq_max_split, to_utf8
+import sys
def catchSqliteException(func):
"""This decorator converts sqlite exceptions into RepoError"""
@@ -42,7 +43,9 @@ def catchSqliteException(func):
try:
return func(*args, **kwargs)
except sqlutils.sqlite.Error, e:
- if hasattr(e, "message"):
+ # 2.4.x requires this, but 2.6.x complains about even hasattr()
+ # of e.message ... *sigh*
+ if sys.hexversion < 0x02050000:
raise Errors.RepoError, str(e.message)
raise Errors.RepoError, str(e)
More information about the Yum-commits
mailing list