From d5a867a1f15c9e2b6abbc746c3de45324f6e4cfe Mon Sep 17 00:00:00 2001 From: vg Date: Wed, 22 Mar 2023 23:29:48 +0100 Subject: fix the move of the type from collections to typing --- contacts_validation/contacts_validation/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'contacts_validation') diff --git a/contacts_validation/contacts_validation/__init__.py b/contacts_validation/contacts_validation/__init__.py index 0f00c18..c9c75be 100644 --- a/contacts_validation/contacts_validation/__init__.py +++ b/contacts_validation/contacts_validation/__init__.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2018 vg@devys.org +# Copyright 2023 vg@devys.org # SPDX-License-Identifier: MIT import collections @@ -7,6 +7,7 @@ import datetime import os import pprint import sys +import typing import jsonschema import yaml @@ -17,10 +18,10 @@ def convert_types(obj): return obj elif isinstance(obj, datetime.date): return obj.strftime('%F') - elif isinstance(obj, collections.Sequence): + elif isinstance(obj, typing.Sequence): for i, _ in enumerate(obj): obj[i] = convert_types(obj[i]) - elif isinstance(obj, collections.Mapping): + elif isinstance(obj, typing.Mapping): for k, v in obj.items(): obj[k] = convert_types(v) -- cgit v1.2.3