Commit ee8bb1a0 authored by Jonathan Michalon's avatar Jonathan Michalon

Fix AttrTree subsetting

AttrTree failed to create correct sub-attributes of itself because the
sub-attributes were not transmitted to the child.
In fact, str.split()'s 2nd argument is the number of split, not
the number of parts so '2' will split in 3 parts.
parent 96d0564b
......@@ -8,7 +8,7 @@ class AttrTree(object):
def install_attr(self, key, default):
if key in self._attrs:
raise KeyError('Key "%s" already exists' % key)
stems = key.split('.', 2)
stems = key.split('.', 1)
if len(stems) < 2:
self._attrs[key] = default
elif stems[0] in self._attrs:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment