From 0f9b5d919cb8e113fbc14dbe1e4d5f5eeb97fe2b Mon Sep 17 00:00:00 2001 From: Diviloper Date: Thu, 21 Dec 2023 00:42:09 +0100 Subject: [PATCH] Fix error for Python 3.8 and 3.9 for type checking Box --- pymeos/pymeos/collections/time/tstzset.py | 4 ++-- pymeos/pymeos/collections/time/tstzspan.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pymeos/pymeos/collections/time/tstzset.py b/pymeos/pymeos/collections/time/tstzset.py index 3cf3d214..5f967ebf 100644 --- a/pymeos/pymeos/collections/time/tstzset.py +++ b/pymeos/pymeos/collections/time/tstzset.py @@ -314,7 +314,7 @@ def is_contained_in( if isinstance(container, Temporal): return self.is_contained_in(container.time()) - elif isinstance(container, Box): + elif isinstance(container, get_args(Box)): return self.is_contained_in(container.to_tstzspan()) else: return super().is_contained_in(container) @@ -409,7 +409,7 @@ def overlaps( ) elif isinstance(other, Temporal): return self.to_spanset().overlaps(other) - elif isinstance(other, Box): + elif isinstance(other, get_args(Box)): return self.to_span().overlaps(other) else: return super().overlaps(other) diff --git a/pymeos/pymeos/collections/time/tstzspan.py b/pymeos/pymeos/collections/time/tstzspan.py index d2592ab3..5e6fd90f 100644 --- a/pymeos/pymeos/collections/time/tstzspan.py +++ b/pymeos/pymeos/collections/time/tstzspan.py @@ -281,7 +281,7 @@ def is_contained_in( if isinstance(container, Temporal): return self.is_contained_in(container.tstzspan()) - elif isinstance(container, Box): + elif isinstance(container, get_args(Box)): return self.is_contained_in(container.to_tstzspan()) else: return super().is_contained_in(container)