Skip to content

Commit c37d0e8

Browse files
fix(tidy3d_extras): fix error message in tidy3d_extras importing
1 parent 61ee7df commit c37d0e8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tidy3d/packaging.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def _check_tidy3d_extras_available():
199199
raise Tidy3dImportError(
200200
"The package 'tidy3d-extras' is absent. "
201201
"Please install the 'tidy3d-extras' package using, for "
202-
"example, 'pip install tidy3d[extras]'."
202+
r"example, 'pip install tidy3d\[extras]'."
203203
)
204204

205205
try:
@@ -210,6 +210,13 @@ def _check_tidy3d_extras_available():
210210
"The package 'tidy3d-extras' did not initialize correctly."
211211
) from exc
212212

213+
if not hasattr(tidy3d_extras_mod, "__version__"):
214+
raise Tidy3dImportError(
215+
"The package 'tidy3d-extras' did not initialize correctly. "
216+
"Please install the 'tidy3d-extras' package using, for "
217+
r"example, 'pip install tidy3d\[extras]'."
218+
)
219+
213220
version = tidy3d_extras_mod.__version__
214221

215222
if version is None:
@@ -222,7 +229,7 @@ def _check_tidy3d_extras_available():
222229
raise Tidy3dImportError(
223230
f"The version of 'tidy3d-extras' is {version}, but the version of 'tidy3d' is {__version__}. "
224231
"They must match. You can install the correct "
225-
"version using 'pip install tidy3d[extras]'."
232+
r"version using 'pip install tidy3d\[extras]'."
226233
)
227234

228235
tidy3d_extras["mod"] = tidy3d_extras_mod

0 commit comments

Comments
 (0)