Replace a nested if chain in DictPath with a single if/elif chain
diff --git a/reclass/utils/dictpath.py b/reclass/utils/dictpath.py
index 39b9572..57971b4 100644
--- a/reclass/utils/dictpath.py
+++ b/reclass/utils/dictpath.py
@@ -61,17 +61,17 @@
def __init__(self, delim, contents=None):
self._delim = delim
+
if contents is None:
self._parts = []
+ elif isinstance(contents, list):
+ self._parts = contents
+ elif isinstance(contents, six.string_types):
+ self._parts = self._split_string(contents)
+ elif isinstance(contents, tuple):
+ self._parts = list(contents)
else:
- if isinstance(contents, list):
- self._parts = contents
- elif isinstance(contents, six.string_types):
- self._parts = self._split_string(contents)
- elif isinstance(contents, tuple):
- self._parts = list(contents)
- else:
- raise TypeError('DictPath() takes string or list, '\
+ raise TypeError('DictPath() takes string or list, '\
'not %s' % type(contents))
def __repr__(self):