Skip to content

Commit 53557d4

Browse files
committed
Fix an import in __init__.py so the package can be vendored
1 parent ac4e03a commit 53557d4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

numpy_array_api_compat/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@
4646
# These imports may overwrite names from the import * above.
4747
from ._aliases import *
4848

49-
# Don't know why, but we have to do this to import linalg. If we instead do
49+
# Don't know why, but we have to do an absolute import to import linalg. If we
50+
# instead do
5051
#
5152
# from . import linalg
5253
#
53-
# It doesn't overwrite np.linalg from above.
54-
import numpy_array_api_compat.linalg
54+
# It doesn't overwrite np.linalg from above. The import is generated
55+
# dynamically so that the library can be vendored.
56+
__import__(__package__ + '.linalg')
5557

5658
from .linalg import matrix_transpose, vecdot
5759

0 commit comments

Comments
 (0)