Don't need to call extra _init_
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Tue, 25 Sep 2018 19:00:03 +0300
changeset 2343 33071a451021
parent 2342 4ec6d6cd23ca
child 2344 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)
xmlclass/xmlclass.py
--- 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: