From fb06cab6227a5dd1979551a2e92739424200ad10 Mon Sep 17 00:00:00 2001 From: Adam Collard Date: Tue, 16 Aug 2022 11:03:07 +0100 Subject: [PATCH 1/2] Fix typo in test configuration --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98a7de1..f65d600 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,5 +53,5 @@ jobs: - name: Test run: | - tox -e py + tox -e py3 codecov From a0673683cf42120852bb8213da6fe5757faf5012 Mon Sep 17 00:00:00 2001 From: Adam Collard Date: Tue, 16 Aug 2022 11:07:11 +0100 Subject: [PATCH 2/2] More Python 3.10 fixes (#282) Fixes #280 --- maas/client/flesh/tabular.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/maas/client/flesh/tabular.py b/maas/client/flesh/tabular.py index 91f202c..a59c097 100644 --- a/maas/client/flesh/tabular.py +++ b/maas/client/flesh/tabular.py @@ -4,6 +4,7 @@ from abc import ABCMeta, abstractmethod import collections +from collections.abc import Iterable import csv import enum from io import StringIO @@ -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 @@ -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) @@ -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)