Skip to content

Commit 9ad580d

Browse files
committed
Fixed build failure.
1 parent 4057c3a commit 9ad580d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

scalene/scalene_magics.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ def line_cell_magic(func: F) -> F: ... # type: ignore[override,unused-ignore]
1414
def line_magic(func: F) -> F: ... # type: ignore[override,unused-ignore]
1515
def magics_class(cls: type) -> type: ... # type: ignore[override,unused-ignore]
1616

17-
else:
18-
from IPython.core.magic import (
19-
Magics,
20-
line_cell_magic,
21-
line_magic,
22-
magics_class,
23-
)
24-
25-
2617
with contextlib.suppress(Exception):
2718

2819
from scalene import scalene_profiler
2920
from scalene.scalene_arguments import ScaleneArguments
3021
from scalene.scalene_parseargs import ScaleneParseArgs
3122

23+
if not TYPE_CHECKING:
24+
with contextlib.suppress(Exception):
25+
from IPython.core.magic import (
26+
Magics,
27+
line_cell_magic,
28+
line_magic,
29+
magics_class,
30+
)
31+
3232
@magics_class
3333
class ScaleneMagics(Magics): # type: ignore[no-any-unimported,unused-ignore]
3434
"""IPython (Jupyter) support for magics for Scalene (%scrun and %%scalene)."""

0 commit comments

Comments
 (0)