Skip to content

Commit 2c5450c

Browse files
committed
safe install
1 parent 7d360a9 commit 2c5450c

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

pymathics/vectorizedplot/__init__.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424

2525
from pymathics.vectorizedplot.version import __version__
2626

27-
from .plot_plot3d import ContourPlot3D, ParametricPlot3D, SphericalPlot3D
27+
ALREADY_INSTALLED = True
28+
try:
29+
from .plot_plot3d import ContourPlot3D, ParametricPlot3D, SphericalPlot3D
30+
except ModuleNotFoundError:
31+
ALREADY_INSTALLED = False
32+
2833

2934
# To be recognized as an external mathics module, the following variable
3035
# is required:
@@ -40,9 +45,16 @@
4045

4146

4247
__all__ = (
43-
"ContourPlot3D",
44-
"ParametricPlot3D",
45-
"SphericalPlot3D",
46-
"__version__",
47-
"pymathics_version_data",
48+
(
49+
"ContourPlot3D",
50+
"ParametricPlot3D",
51+
"SphericalPlot3D",
52+
"__version__",
53+
"pymathics_version_data",
54+
)
55+
if ALREADY_INSTALLED
56+
else (
57+
"__version__",
58+
"pymathics_version_data",
59+
)
4860
)

0 commit comments

Comments
 (0)