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/rcode.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/rcode.py')
| -rw-r--r-- | dns/rcode.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dns/rcode.py b/dns/rcode.py index e8f1ee4..c055f2e 100644 --- a/dns/rcode.py +++ b/dns/rcode.py @@ -58,7 +58,7 @@ class UnknownRcode(dns.exception.DNSException): def from_text(text): """Convert text into an rcode. - + @param text: the texual rcode @type text: string @raises UnknownRcode: the rcode is unknown @@ -87,7 +87,7 @@ def from_flags(flags, ednsflags): value = (flags & 0x000f) | ((ednsflags >> 20) & 0xff0) if value < 0 or value > 4095: - raise ValueError, 'rcode must be >= 0 and <= 4095' + raise ValueError('rcode must be >= 0 and <= 4095') return value def to_flags(value): @@ -100,7 +100,7 @@ def to_flags(value): """ if value < 0 or value > 4095: - raise ValueError, 'rcode must be >= 0 and <= 4095' + raise ValueError('rcode must be >= 0 and <= 4095') v = value & 0xf ev = long(value & 0xff0) << 20 return (v, ev) @@ -112,7 +112,7 @@ def to_text(value): @type value: int @rtype: string """ - + text = _by_value.get(value) if text is None: text = str(value) |
