Skip to content

Commit 362bae3

Browse files
committed
[xmlparser] Remove re-setting of object attributes
XMLReader.parse_tag contained code re-setting attributes of previously instantiated odML objects. This code has been made obsolete by previous rewriting of the instantiation method and is potentially harmful by circumventing instantiation attribute checks. It is therefore removed.
1 parent 7088abe commit 362bae3

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

odml/tools/xmlparser.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,19 +288,6 @@ def parse_tag(self, root, fmt, insert_children=True):
288288
# Instantiate the current odML object with the parsed attributes.
289289
obj = fmt.create(**arguments)
290290

291-
for k, v in arguments.items():
292-
if hasattr(obj, k) and (getattr(obj, k) is None or k == 'id'):
293-
try:
294-
if k == 'id' and v is not None:
295-
obj._id = v
296-
else:
297-
setattr(obj, k, v)
298-
except Exception as e:
299-
self.warn("cannot set '%s' property on <%s>: %s" %
300-
(k, root.tag, repr(e)), root)
301-
if not self.ignore_errors:
302-
raise e
303-
304291
if insert_children:
305292
for child in children:
306293
obj.append(child)

0 commit comments

Comments
 (0)