Skip to content

Commit

Permalink
More Python 3.10 fixes (#282)
Browse files Browse the repository at this point in the history
Fixes #280
  • Loading branch information
sparkiegeek authored Aug 16, 2022
1 parent fb06cab commit a067368
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions maas/client/flesh/tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from abc import ABCMeta, abstractmethod
import collections
from collections.abc import Iterable
import csv
import enum
from io import StringIO
Expand Down Expand Up @@ -297,9 +298,7 @@ def render(self, target, datum):
elif target is RenderTarget.json:
return datum
elif target is RenderTarget.csv:
if isinstance(datum, collections.Iterable) and not isinstance(
datum, (str, bytes)
):
if isinstance(datum, Iterable) and not isinstance(datum, (str, bytes)):
return ",".join(datum)
else:
return datum
Expand All @@ -308,9 +307,7 @@ def render(self, target, datum):
return ""
elif isinstance(datum, colorclass.Color):
return datum.value_no_colors
elif isinstance(datum, collections.Iterable) and not isinstance(
datum, (str, bytes)
):
elif isinstance(datum, Iterable) and not isinstance(datum, (str, bytes)):
return "\n".join(datum)
else:
return str(datum)
Expand All @@ -319,9 +316,7 @@ def render(self, target, datum):
return ""
elif isinstance(datum, colorclass.Color):
return datum
elif isinstance(datum, collections.Iterable) and not isinstance(
datum, (str, bytes)
):
elif isinstance(datum, Iterable) and not isinstance(datum, (str, bytes)):
return "\n".join(datum)
else:
return str(datum)
Expand Down

0 comments on commit a067368

Please sign in to comment.