[Python-Dev] where is the python "import" implemented

martin at v.loewis.de martin at v.loewis.de
Tue Dec 11 10:08:29 CET 2012

>         in this situation, I can not find the source code how python
> implement it. I test a wrong format pyc, and got a error "ImportError: bad
> magic number",and I search "bad magic number" in the source code,  I
> find it is in importlib/_bootstrap.py(line 815),but when I modify this
> error info(eg: test bad magic) and run again, nothing is changed. It seems
> that the file is not the correct position.

This is the right position. When you change _bootstrap.py, you need to
run "make" again, to freeze the modified _bootstrap.py.


More information about the Python-Dev mailing list