##// END OF EJS Templates
Fix extension detection...
Fix extension detection If the path leading up to the Python installation's `site-packages` contains a `.`, this check does not do what it says it does :( For instance, on macOS, the `site-packages` directory is located at `/usr/local/lib/python3.7/site-packages`, which means that trying to use the magic `%run -m my.module` will always fail, because `split_path[1]` will always start with `7/site-packages`. There are better ways to check that a file extension matches expectations, but I thought it was cute that I could fix this bug by inserting a single character :) My current workaround looks like this: ```python import importlib import_path = importlib.util.find_spec('my.module').origin %run $import_path ```

File last commit:

r22934:4036b3d9
r24836:525c7fe6
Show More
test_imports.py
20 lines | 439 B | text/x-python | PythonLexer
# encoding: utf-8
def test_import_coloransi():
from IPython.utils import coloransi
def test_import_generics():
from IPython.utils import generics
def test_import_ipstruct():
from IPython.utils import ipstruct
def test_import_PyColorize():
from IPython.utils import PyColorize
def test_import_strdispatch():
from IPython.utils import strdispatch
def test_import_wildcard():
from IPython.utils import wildcard