diff options
author | Bob Halley <halley@dnspython.org> | 2020-08-19 05:30:30 -0700 |
---|---|---|
committer | Bob Halley <halley@dnspython.org> | 2020-08-19 05:30:30 -0700 |
commit | bee23ec15fdde8f0303b0a3699669599c5abf8cb (patch) | |
tree | 4163adbd42903cff6db95083712b0874c251879e /dns/rdtypes/ANY/TKEY.py | |
parent | 04d65197c72930fbc2857e7384418d6f045f7aa0 (diff) | |
download | dnspython-bee23ec15fdde8f0303b0a3699669599c5abf8cb.tar.gz |
make name and rdata use the immutable decoratormore-immut
Diffstat (limited to 'dns/rdtypes/ANY/TKEY.py')
-rw-r--r-- | dns/rdtypes/ANY/TKEY.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/dns/rdtypes/ANY/TKEY.py b/dns/rdtypes/ANY/TKEY.py index 70bac63..871578a 100644 --- a/dns/rdtypes/ANY/TKEY.py +++ b/dns/rdtypes/ANY/TKEY.py @@ -19,10 +19,12 @@ import base64 import struct import dns.dnssec +import dns.immutable import dns.exception import dns.rdata +@dns.immutable.immutable class TKEY(dns.rdata.Rdata): """TKEY Record""" @@ -33,13 +35,13 @@ class TKEY(dns.rdata.Rdata): def __init__(self, rdclass, rdtype, algorithm, inception, expiration, mode, error, key, other=b''): super().__init__(rdclass, rdtype) - object.__setattr__(self, 'algorithm', algorithm) - object.__setattr__(self, 'inception', inception) - object.__setattr__(self, 'expiration', expiration) - object.__setattr__(self, 'mode', mode) - object.__setattr__(self, 'error', error) - object.__setattr__(self, 'key', dns.rdata._constify(key)) - object.__setattr__(self, 'other', dns.rdata._constify(other)) + self.algorithm = self.as_value(algorithm) + self.inception = self.as_value(inception) + self.expiration = self.as_value(expiration) + self.mode = self.as_value(mode) + self.error = self.as_value(error) + self.key = self.as_value(dns.rdata._constify(key)) + self.other = self.as_value(dns.rdata._constify(other)) def to_text(self, origin=None, relativize=True, **kw): _algorithm = self.algorithm.choose_relativity(origin, relativize) |