
Oct. 1, 2004
1:09 a.m.
Quoting "Phillip J. Eby" <pje@telecommunity.com>:
Using the C equivalent of 'imp.find_module()' should cover all these cases, and any new forms of PY_SOURCE or PY_COMPILED that come up in future.
That's essentially what the patch does. PyRun_SimpleModuleFlags uses _PyImport_FindModule to obtain the absolute file location, then uses PyRun_SimpleFileExFlags to actually run the script. _PyImport_FindModule is a trivial wrapper around import.c's find_module() (which, I believe, is what imp.find_module() invokes) When multiple versions exist, the patch operates on what find_module() returns (which ends up using the preference order '.py', '.pyw', '.py[co]') Cheers, Nick. -- Nick Coghlan Brisbane, Australia