Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grass.gunittest: Use collections.abc for Iterable (#2006) #2008

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/python/gunittest/reporters.py
Expand Up @@ -17,6 +17,7 @@
import sys
import collections
import re
from collections.abc import Iterable

from .utils import ensure_dir
from .checkers import text_to_keyvalue
Expand All @@ -37,8 +38,7 @@ def keyvalue_to_text(keyvalue, sep='=', vsep='\n', isep=',',
items = []
for key, value in keyvalue.items():
# TODO: use isep for iterables other than strings
if (not isinstance(value, str)
and isinstance(value, collections.Iterable)):
if not isinstance(value, str) and isinstance(value, Iterable):
# TODO: this does not work for list of non-strings
value = isep.join(value)
items.append('{key}{sep}{value}'.format(
Expand Down