[yum-commits] Branch 'yum-3_2_X' - yum/pgpmsg.py
Tim Lauridsen
timlau at osuosl.org
Mon Mar 30 08:56:34 UTC 2009
yum/pgpmsg.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 2423fdb0a5cefc3b7015bb6a9335590c6fc9c1bd
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date: Mon Mar 30 10:56:22 2009 +0200
fix Raising a string exception pylint warnings
diff --git a/yum/pgpmsg.py b/yum/pgpmsg.py
index 04ab346..2d9e7d9 100644
--- a/yum/pgpmsg.py
+++ b/yum/pgpmsg.py
@@ -449,7 +449,7 @@ class public_key(pgp_packet) :
idx_save = idx
self.version, idx = get_whole_int(msg, idx, 1)
if self.version != 2 and self.version != 3 and self.version != 4 :
- raise 'unknown public key packet version %d at %d' % (self.version, idx_save)
+ raise RuntimeError('unknown public key packet version %d at %d' % (self.version, idx_save))
if self.version == 2 : # map v2 into v3 for coding simplicity since they're structurally the same
self.version = 3
self.timestamp, idx = get_whole_number(msg, idx, 4)
@@ -471,7 +471,7 @@ class public_key(pgp_packet) :
self.pk_elgamal_grp_gen_g, idx = get_mpi(msg, idx)
self.pk_elgamal_pub_key, idx = get_mpi(msg, idx)
else :
- raise "unknown public key algorithm %d at %d" % (self.pk_algo, idx_save)
+ raise RuntimeError("unknown public key algorithm %d at %d" % (self.pk_algo, idx_save))
def __str__(self) :
sio = cStringIO.StringIO()
@@ -746,7 +746,7 @@ class signature(pgp_packet) :
sp, idx = self.deserialize_subpacket(msg, idx)
self.unhashed_subpaks.append(sp)
else :
- raise 'unknown signature packet version %d at %d' % (self.version, idx)
+ raise RuntimeError('unknown signature packet version %d at %d' % (self.version, idx))
self.hash_frag, idx = get_whole_number(msg, idx, 2)
if self.pk_algo == ALGO_PK_RSA_ENC_OR_SIGN or self.pk_algo == ALGO_PK_RSA_SIGN_ONLY :
self.rsa_sig, idx = get_mpi(msg, idx)
@@ -754,7 +754,7 @@ class signature(pgp_packet) :
self.dsa_sig_r, idx = get_mpi(msg, idx)
self.dsa_sig_s, idx = get_mpi(msg, idx)
else :
- raise 'unknown public-key algorithm (%d) in signature at %d' % (self.pk_algo, idx)
+ raise RuntimeError('unknown public-key algorithm (%d) in signature at %d' % (self.pk_algo, idx))
return idx
def __str__(self) :
@@ -1079,7 +1079,7 @@ def decode(msg) :
if debug :
debug.write(pkt.__str__() + "\n")
else :
- raise 'unknown pgp packet type %d at %d' % (pkt_typ, idx)
+ raise RuntimeError('unknown pgp packet type %d at %d' % (pkt_typ, idx))
pkt_list.append(pkt)
More information about the Yum-commits
mailing list