From f98493ab45a731e9bf1cb73cc141bc04423cdd3c Mon Sep 17 00:00:00 2001
From: Hannes Feldt <feldt@astron.nl>
Date: Wed, 15 May 2024 14:46:32 +0200
Subject: [PATCH] remove pre python 3.8 compat workarounds
---
.../file_access/_compat_utils.py | 28 +------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/lofar_station_client/file_access/_compat_utils.py b/lofar_station_client/file_access/_compat_utils.py
index 1dc749f..245d5dd 100644
--- a/lofar_station_client/file_access/_compat_utils.py
+++ b/lofar_station_client/file_access/_compat_utils.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy)
+# Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
# pylint: disable-all
@@ -8,32 +8,6 @@
Contains required methods missing in older python versions.
"""
-try:
- # Python >=3.8 should have these functions already
- from typing import get_args
- from typing import get_origin
-except ImportError:
- import typing
- import collections
-
- def get_origin(tp):
- """Copied from the Python 3.8 typing module"""
- if isinstance(tp, typing._GenericAlias):
- return tp.__origin__
- if tp is typing.Generic:
- return typing.Generic
- return None
-
- def get_args(tp):
- """Copied from the Python 3.8 typing module"""
- if isinstance(tp, typing._GenericAlias):
- res = tp.__args__
- if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis:
- res = (list(res[:-1]), res[-1])
- return res
- return ()
-
-
try:
from inspect import get_annotations
except ImportError:
--
GitLab