summaryrefslogtreecommitdiff
path: root/constructor.py
diff options
context:
space:
mode:
Diffstat (limited to 'constructor.py')
-rw-r--r--constructor.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/constructor.py b/constructor.py
index 3cc76a3..1673479 100644
--- a/constructor.py
+++ b/constructor.py
@@ -1635,7 +1635,10 @@ class RoundTripConstructor(SafeConstructor):
data.__setstate__(state)
else:
state = SafeConstructor.construct_mapping(self, node)
- data.__dict__.update(state)
+ if hasattr(data, '__attrs_attrs__'): # issue 394
+ cls.__init__(cls, **state)
+ else:
+ data.__dict__.update(state)
if node.anchor:
from ruamel.yaml.serializer import templated_id
from ruamel.yaml.anchor import Anchor