X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/16b98abca94343770aad561ea659380c97d473b4..114e8357e65384e17baaa3c31aa528371e15679b:/src/black/handle_ipynb_magics.py?ds=sidebyside diff --git a/src/black/handle_ipynb_magics.py b/src/black/handle_ipynb_magics.py index 9e1af75..4324819 100644 --- a/src/black/handle_ipynb_magics.py +++ b/src/black/handle_ipynb_magics.py @@ -58,8 +58,13 @@ class Replacement: @lru_cache() def jupyter_dependencies_are_installed(*, verbose: bool, quiet: bool) -> bool: try: - import IPython # noqa:F401 + # isort: off + # tokenize_rt is less commonly installed than IPython + # and IPython is expensive to import import tokenize_rt # noqa:F401 + import IPython # noqa:F401 + + # isort: on except ModuleNotFoundError: if verbose or not quiet: msg = ( @@ -330,7 +335,8 @@ class CellMagicFinder(ast.NodeVisitor): For example, - %%time\nfoo() + %%time\n + foo() would have been transformed to