diff options
| author | Bob Halley <halley@nominum.com> | 2010-01-14 14:51:06 -0800 |
|---|---|---|
| committer | Bob Halley <halley@nominum.com> | 2010-01-14 14:51:06 -0800 |
| commit | 53cb0eb5cfb463ebd0fdad55026ba25ac5c898d4 (patch) | |
| tree | 10328f74009a1bdb93a5b924df5f1610417e370c /dns/tsig.py | |
| parent | 4fbaa1dce221a1bd1b24c5c5e88bab088c13be9f (diff) | |
| download | dnspython-53cb0eb5cfb463ebd0fdad55026ba25ac5c898d4.tar.gz | |
create exceptions with arguments as "raise E(args)" instead of "raise E, args"
Diffstat (limited to 'dns/tsig.py')
| -rw-r--r-- | dns/tsig.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dns/tsig.py b/dns/tsig.py index 175bb2e..b4deeca 100644 --- a/dns/tsig.py +++ b/dns/tsig.py @@ -89,7 +89,7 @@ def sign(wire, keyname, secret, time, fudge, original_id, error, pre_mac = algorithm_name + time_mac ol = len(other_data) if ol > 65535: - raise ValueError, 'TSIG Other Data is > 65535 bytes' + raise ValueError('TSIG Other Data is > 65535 bytes') post_mac = struct.pack('!HH', error, ol) + other_data if first: ctx.update(pre_mac) @@ -155,7 +155,7 @@ def validate(wire, keyname, secret, now, request_mac, tsig_start, tsig_rdata, elif error == BADTRUNC: raise PeerBadTruncation else: - raise PeerError, 'unknown TSIG error code %d' % error + raise PeerError('unknown TSIG error code %d' % error) time_low = time - fudge time_high = time + fudge if now < time_low or now > time_high: @@ -212,5 +212,5 @@ def get_algorithm(algorithm): if algorithm in hashes: return (algorithm.to_digestable(), hashes[algorithm]) - raise NotImplementedError, "TSIG algorithm " + str(algorithm) + \ - " is not supported" + raise NotImplementedError("TSIG algorithm " + str(algorithm) + + " is not supported") |
