##// 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 ```
Christopher Brown -
r24836:525c7fe6
Show More
Name Size Modified Last Commit Author
/ IPython / utils / tests
__init__.py Loading ...
test_capture.py Loading ...
test_decorators.py Loading ...
test_dir2.py Loading ...
test_imports.py Loading ...
test_importstring.py Loading ...
test_io.py Loading ...
test_module_paths.py Loading ...
test_openpy.py Loading ...
test_path.py Loading ...
test_process.py Loading ...
test_pycolorize.py Loading ...
test_shimmodule.py Loading ...
test_sysinfo.py Loading ...
test_tempdir.py Loading ...
test_text.py Loading ...
test_tokenutil.py Loading ...
test_wildcard.py Loading ...