Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LOFAR Station Client
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LOFAR2.0
LOFAR Station Client
Commits
f98493ab
Commit
f98493ab
authored
1 year ago
by
Hannes Feldt
Browse files
Options
Downloads
Patches
Plain Diff
remove pre python 3.8 compat workarounds
parent
26136fce
Branches
Branches containing commit
No related tags found
1 merge request
!89
L2SS-1740: Move modules to prepare for statistics metadata
Pipeline
#81924
failed
1 year ago
Stage: image
Stage: lint
Stage: test
Stage: package
Stage: integration
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lofar_station_client/file_access/_compat_utils.py
+1
-27
1 addition, 27 deletions
lofar_station_client/file_access/_compat_utils.py
with
1 addition
and
27 deletions
lofar_station_client/file_access/_compat_utils.py
+
1
−
27
View file @
f98493ab
# Copyright (C) 202
2
ASTRON (Netherlands Institute for Radio Astronomy)
# Copyright (C) 202
4
ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: Apache-2.0
# pylint: disable-all
# pylint: disable-all
...
@@ -8,32 +8,6 @@
...
@@ -8,32 +8,6 @@
Contains required methods missing in older python versions.
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
:
try
:
from
inspect
import
get_annotations
from
inspect
import
get_annotations
except
ImportError
:
except
ImportError
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment