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/rdataclass.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/rdataclass.py')
| -rw-r--r-- | dns/rdataclass.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dns/rdataclass.py b/dns/rdataclass.py index 278f378..887fd1a 100644 --- a/dns/rdataclass.py +++ b/dns/rdataclass.py @@ -77,7 +77,7 @@ def from_text(text): @raises dns.rdataclass.UnknownRdataClass: the class is unknown @raises ValueError: the rdata class value is not >= 0 and <= 65535 """ - + value = _by_text.get(text.upper()) if value is None: match = _unknown_class_pattern.match(text) @@ -85,7 +85,7 @@ def from_text(text): raise UnknownRdataclass value = int(match.group(1)) if value < 0 or value > 65535: - raise ValueError, "class must be between >= 0 and <= 65535" + raise ValueError("class must be between >= 0 and <= 65535") return value def to_text(value): @@ -97,7 +97,7 @@ def to_text(value): """ if value < 0 or value > 65535: - raise ValueError, "class must be between >= 0 and <= 65535" + raise ValueError("class must be between >= 0 and <= 65535") text = _by_value.get(value) if text is None: text = 'CLASS' + `value` @@ -108,7 +108,7 @@ def is_metaclass(rdclass): @param rdclass: the rdata class @type rdclass: int @rtype: bool""" - + if _metaclasses.has_key(rdclass): return True return False |
