diff options
author | Aaron Meurer <asmeurer@gmail.com> | 2021-08-05 17:31:47 -0600 |
---|---|---|
committer | Aaron Meurer <asmeurer@gmail.com> | 2021-08-05 17:31:47 -0600 |
commit | 3730fc06cd821ec0d7794a6ae058141400921dba (patch) | |
tree | 27b652af9accc6dfdfbf562105e2822f919ea9c6 /numpy/array_api | |
parent | 310929d12967cb0e8e6615466ff9b9f62fc899b6 (diff) | |
download | numpy-3730fc06cd821ec0d7794a6ae058141400921dba.tar.gz |
Give a better error when numpy.array_api is imported in Python 3.7
Diffstat (limited to 'numpy/array_api')
-rw-r--r-- | numpy/array_api/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/array_api/__init__.py b/numpy/array_api/__init__.py index 1e9790a14..08d19744f 100644 --- a/numpy/array_api/__init__.py +++ b/numpy/array_api/__init__.py @@ -115,6 +115,12 @@ Still TODO in this module are: """ +import sys +# numpy.array_api is 3.8+ because it makes extensive use of positional-only +# arguments. +if sys.version_info < (3, 8): + raise ImportError("The numpy.array_api submodule requires Python 3.8 or greater.") + import warnings warnings.warn("The numpy.array_api submodule is still experimental. See NEP 47.", stacklevel=2) |