Skip to content

Commit c39fdbf

Browse files
committed
Set the stacklevel in the set_array_api_strict_flags() warnings
1 parent 71c5231 commit c39fdbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

array_api_strict/_flags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ def set_array_api_strict_flags(
126126
if api_version not in supported_versions:
127127
raise ValueError(f"Unsupported standard version {api_version!r}")
128128
if api_version == "2021.12":
129-
warnings.warn("The 2021.12 version of the array API specification was requested but the returned namespace is actually version 2022.12")
129+
warnings.warn("The 2021.12 version of the array API specification was requested but the returned namespace is actually version 2022.12", stacklevel=2)
130130
if api_version == "2023.12":
131-
warnings.warn("The 2023.12 version of the array API specification is still preliminary. Some functions are not yet implemented, and it has not been fully tested.")
131+
warnings.warn("The 2023.12 version of the array API specification is still preliminary. Some functions are not yet implemented, and it has not been fully tested.", stacklevel=2)
132132
API_VERSION = api_version
133133
array_api_strict.__array_api_version__ = API_VERSION
134134

0 commit comments

Comments
 (0)