summaryrefslogtreecommitdiff
path: root/dns/name.py
diff options
context:
space:
mode:
Diffstat (limited to 'dns/name.py')
-rw-r--r--dns/name.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/dns/name.py b/dns/name.py
index 44af098..0c1d4ab 100644
--- a/dns/name.py
+++ b/dns/name.py
@@ -168,6 +168,13 @@ class Name(object):
def __deepcopy__(self, memo):
return Name(copy.deepcopy(self.labels, memo))
+ def __getstate__(self):
+ return { 'labels' : self.labels }
+
+ def __setstate__(self, state):
+ super(Name, self).__setattr__('labels', state['labels'])
+ _validate_labels(self.labels)
+
def is_absolute(self):
"""Is the most significant label of this name the root label?
@rtype: bool