<DIV>According to your advice, Now I can see my modified log. It's great! Thanks to Antoine and Martin!</DIV>
<DIV> </DIV>
<DIV><includetail>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV><BR>Hello,<BR><BR>Le Tue, 11 Dec 2012 14:08:27 +0800,<BR>"Isml" <76069016@qq.com> a écrit :<BR>> Hi, everyone,<BR>> I am testing modifying the pyc file when it is imported. As I<BR>> know, there is three situation: 1、runing in the python.exe<BR>> eg: python.exe test.pyc<BR>> in this situation, I find the source on line 1983 in file<BR>> pythonrun.c 2、import the pyc from a zip file<BR>> I find the source on line 1132 in zipimport.c<BR>> 3、do a normal import<BR>> eg: two file : main.py and testmodule.py<BR>> and in main.py:<BR>> import testmodule<BR>> <BR>> in this situation, I can not find the source code how python<BR>> implement it. I test a wrong format pyc, and got a error<BR>> "ImportError: bad magic number",and I search "bad magic number" in<BR>> the source code, I find it is in importlib/_bootstrap.py(line<BR>> 815),but when I modify this error info(eg: test bad magic) and run<BR>> again, nothing is changed. It seems that the file is not the correct<BR>> position.<BR><BR>importlib/_bootstrap.py is indeed the place, but you need to run "make"<BR>once you have modified that file. _bootstrap.py is frozen into the<BR>executable at compile time, because otherwise the bootstrap issues are<BR>intractable.<BR><BR>Regards<BR><BR>Antoine.<BR><BR><BR>_______________________________________________<BR>Python-Dev mailing list<BR>Python-Dev@python.org<BR>http://mail.python.org/mailman/listinfo/python-dev<BR>Unsubscribe: http://mail.python.org/mailman/options/python-dev/76069016%40qq.com<BR>
<DIV></DIV></includetail></DIV>