This now checks for _iter_ instead, but also ignores strings.

This commit is contained in:
Ben Griffin 2020-03-05 11:54:58 +00:00
parent 2bf9c584b7
commit 1712862b7e
1 changed files with 2 additions and 1 deletions

View File

@ -1143,8 +1143,9 @@ class RawConfigParser(MutableMapping):
"""
var_dict = {}
section_is_iterable = not isinstance(section, str) and hasattr(section, '__iter__')
section_list = section if section_is_iterable else [section]
section_list = section if hasattr(section, '__iter__') else [section]
map_list = []
if vars: