beremiz

Don't need to call extra _init_

2018-09-25, Andrey Skvortsov
33071a451021
Parents 4ec6d6cd23ca
Children 94045bfa2d94
Don't need to call extra _init_

_init_ is already called for value in infos["elmt_type"]["initial"]().
Additional _init_() creates second set of child element and that
creates unusable xml project.
This regression cause by not well tested commit "Proper fix for error
'object has no attribute 'getSlave' in EtherCAT extension" (96ca6b056c55595f71bfaca9f54b9e8646460c23)
--- a/xmlclass/xmlclass.py Tue Sep 25 18:31:17 2018 +0300
+++ b/xmlclass/xmlclass.py Tue Sep 25 19:00:03 2018 +0300
@@ -627,7 +627,6 @@
value = infos["elmt_type"]["initial"]()
if infos["type"] != ANY:
DefaultElementClass.__setattr__(value, "tag", element_name)
- value._init_()
return value
return [initial_value() for dummy in xrange(infos["minOccurs"])]
else: