Skip to content

Commit

Permalink
grass.gunittest: Use collections.abc for Iterable (#2006)
Browse files Browse the repository at this point in the history
Python 3.10 does not have Iterable in collections anymore and requires collections.abc.Iterable.
  • Loading branch information
wenzeslaus authored and neteler committed Dec 7, 2021
1 parent 6b800ed commit b4828da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/grass/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 @@ -36,7 +37,7 @@ def keyvalue_to_text(keyvalue, sep="=", vsep="\n", isep=",", last_vertical=None)
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(key=key, sep=sep, value=value))
Expand Down

0 comments on commit b4828da

Please sign in to comment.