Skip to content

Commit c663ec8

Browse files
Apply suggestions from code review
Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>
1 parent 733976e commit c663ec8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

stlib/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def findName(cname, names):
2626
isNode=True
2727
elif isinstance(typeName, type) and issubclass(typeName, Sofa.Core.Object):
2828
params["name"] = typeName.name.value
29-
elif isinstance(typeName, type) and issubclass(typeName, Sofa.Core.ObjectDeclaration):
29+
elif isinstance(typeName, type) and issubclass(typeName, Sofa.Core.ObjectDeclaration):
3030
params["name"] = typeName.__name__
3131
else:
3232
raise RuntimeError("Invalid argument ", typeName)
@@ -40,10 +40,8 @@ def findName(cname, names):
4040
# Dispatch the creation to either addObject or addChild
4141
if isinstance(typeName, type) and issubclass(typeName, Sofa.Core.Node):
4242
pref = self.addChild(typeName(params["name"]))
43-
pref.init()
4443
elif isinstance(typeName, Sofa.Core.Node):
4544
pref = self.addChild(typeName)
46-
pref.init()
4745
elif isinstance(typeName, type) and issubclass(typeName, Sofa.Core.Object):
4846
pref = self.addObject(typeName(**params))
4947
elif isinstance(typeName, type) and issubclass(typeName, Sofa.Core.ObjectDeclaration):

0 commit comments

Comments
 (0)