Benjamin Peterson wrote: > On Mon, Nov 3, 2008 at 7:25 AM, Benjamin Peterson > <[EMAIL PROTECTED]> wrote: >> On Mon, Nov 3, 2008 at 1:04 AM, adrian golding <[EMAIL PROTECTED]> wrote: >>> hi all, i am trying to find out where is the part of the code in the python >>> interpreter that opens up the .py file and parses it. in particular, i am >>> trying to find the file open command in that file. I greped and i just want >>> to make sure this is it: /Python-2.6/Parser/pgenmain.c >>> i am intending to take a hash measurement of the .py file just before i open >>> it to run the script. is the above file the right place to call for the >>> measurement before the file open function? >> You want Parser/tokenizer.c. > > Sorry, that's not correct. opening of modules happens in > Python/import.c. There's also a case in Modules/main.c.
And some indirect ones from runpy.py (via pkgutils) if you use the -m switch, or are executing a zipfile or directory. But for the specific case of an exact filename being provided on the command line, then main.c is the one the original poster will want to look at (line 567 to be exact). Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com