From 83457f67e04967b6e7ae9340a6b966d9c237d914 Mon Sep 17 00:00:00 2001 From: solenn-tl Date: Fri, 9 Dec 2022 09:16:08 +0100 Subject: [PATCH 1/2] Update library name for Python10+ --- nlstruct/registry.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nlstruct/registry.py b/nlstruct/registry.py index a8842fc..3d2b8b6 100644 --- a/nlstruct/registry.py +++ b/nlstruct/registry.py @@ -1,7 +1,10 @@ import inspect import functools import torch -from collections import Mapping +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping from copy import deepcopy import abc From 84cc5c37cc1eda4d4483a4badfbb3fd72a2713d4 Mon Sep 17 00:00:00 2001 From: solenn-tl Date: Wed, 14 Dec 2022 11:10:09 +0100 Subject: [PATCH 2/2] Update library name for Python10+ --- nlstruct/torch_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nlstruct/torch_utils.py b/nlstruct/torch_utils.py index 1572c55..fe6cf54 100644 --- a/nlstruct/torch_utils.py +++ b/nlstruct/torch_utils.py @@ -2,7 +2,11 @@ import random import re import math -from collections import defaultdict, Sequence +try: + from collections.abc import Sequence +except ImportError: + from collections import Sequence +from collections import defaultdict from collections import namedtuple from contextlib import contextmanager from itertools import zip_longest