Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #34283: Prevent circular import of matrix space
The issue occurs randomly when testing ticket #34185 on a system with the optional package meataxe being present. For example {{{#!python sage -tp --hide=meataxe src/sage/knots/ Traceback (most recent call last): File "/home/sebastian/devel/sage/src/bin/sage-runtests", line 157, in <module> err = DC.run() File "/home/sebastian/devel/sage/local/var/lib/sage/venv- python3.8/lib/python3.8/site-packages/sage/doctest/control.py", line 1439, in run if f.is_present(): File "/home/sebastian/devel/sage/local/var/lib/sage/venv- python3.8/lib/python3.8/site-packages/sage/features/__init__.py", line 182, in is_present res = self._is_present() File "/home/sebastian/devel/sage/local/var/lib/sage/venv- python3.8/lib/python3.8/site-packages/sage/features/join_feature.py", line 63, in _is_present test = f._is_present() File "/home/sebastian/devel/sage/local/var/lib/sage/venv- python3.8/lib/python3.8/site-packages/sage/features/__init__.py", line 950, in _is_present importlib.import_module(self.name) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 1174, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "sage/matrix/matrix_gfpn_dense.pyx", line 1, in init sage.matrix.matrix_gfpn_dense (build/cythonized/sage/matrix/matrix_gfpn_dense.c:21852) File "sage/matrix/matrix_dense.pyx", line 1, in init sage.matrix.matrix_dense (build/cythonized/sage/matrix/matrix_dense.c:7897) File "sage/matrix/matrix2.pyx", line 1, in init sage.matrix.matrix2 (build/cythonized/sage/matrix/matrix2.c:127958) File "sage/matrix/matrix1.pyx", line 1, in init sage.matrix.matrix1 (build/cythonized/sage/matrix/matrix1.c:25542) File "sage/matrix/matrix0.pyx", line 28, in init sage.matrix.matrix0 (build/cythonized/sage/matrix/matrix0.c:45663) File "/home/sebastian/devel/sage/local/var/lib/sage/venv- python3.8/lib/python3.8/site-packages/sage/modules/free_module.py", line 182, in <module> import sage.matrix.matrix_space File "/home/sebastian/devel/sage/local/var/lib/sage/venv- python3.8/lib/python3.8/site-packages/sage/matrix/matrix_space.py", line 40, in <module> from . import matrix_generic_dense File "sage/matrix/matrix_generic_dense.pyx", line 1, in init sage.matrix.matrix_generic_dense (build/cythonized/sage/matrix/matrix_generic_dense.c:6637) AttributeError: partially initialized module 'sage.matrix.matrix_dense' has no attribute 'Matrix_dense' (most likely due to a circular import) }}} Of course this also occurs (randomly) with option `--hide=all` or `--hide=optional`. Part of Meta-ticket #33580: make all modules importable without sage.all URL: https://trac.sagemath.org/34283 Reported by: soehms Ticket author(s): Sebastian Oehms Reviewer(s): Matthias Koeppe
- Loading branch information