Skip to content

Commit 6bf7ac2

Browse files
committed
BUG: fix import error against Python's optimized mode
1 parent d086c61 commit 6bf7ac2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

array_api_strict/_flags.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,13 @@ def set_array_api_strict_flags(
169169
set(default_extensions))
170170

171171
# We have to do this separately or it won't get added as the docstring
172-
set_array_api_strict_flags.__doc__ = set_array_api_strict_flags.__doc__.format(
173-
supported_versions=supported_versions,
174-
default_version=default_version,
175-
default_extensions=default_extensions,
176-
draft_version=draft_version,
177-
)
172+
if set_array_api_strict_flags.__doc__ is not None:
173+
set_array_api_strict_flags.__doc__ = set_array_api_strict_flags.__doc__.format(
174+
supported_versions=supported_versions,
175+
default_version=default_version,
176+
default_extensions=default_extensions,
177+
draft_version=draft_version,
178+
)
178179

179180
def get_array_api_strict_flags():
180181
"""

0 commit comments

Comments
 (0)