Skip to content

Commit

Permalink
Refactor try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
mewwts committed Oct 10, 2016
1 parent 5fe1f49 commit 521c769
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions addict/addict.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ def __init__(self, *args, **kwargs):
elif isinstance(arg, tuple) and (not isinstance(arg[0], tuple)):
self[arg[0]] = self._hook(arg[1])
else:
try:
for key, val in iter(arg):
self[key] = self._hook(val)
except TypeError:
raise TypeError("Dict does not understand "
"{0} types".format(type(arg)))
for key, val in iter(arg):
self[key] = self._hook(val)

for key, val in kwargs.items():
self[key] = val
Expand Down

0 comments on commit 521c769

Please sign in to comment.