Skip to content

Commit

Permalink
Merge isinstance calls
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos authored and martinblech committed May 3, 2024
1 parent aecdfb3 commit 9c3ec3c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions xmltodict.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,7 @@ def _emit(key, value, content_handler,
if result is None:
return
key, value = result
if (not hasattr(value, '__iter__')
or isinstance(value, _basestring)
or isinstance(value, dict)):
if not hasattr(value, '__iter__') or isinstance(value, (_basestring, dict)):
value = [value]
for index, v in enumerate(value):
if full_document and depth == 0 and index > 0:
Expand Down

0 comments on commit 9c3ec3c

Please sign in to comment.