gh-141276: Avoid compiling zipimport source in get_filename (#153799)
`zipimporter.get_filename()` compiled source modules just to work out the
module's file name. `find_spec()` calls it through `spec_from_loader()`, so
importing a source module from a ZIP archive compiled it twice and emitted
every `SyntaxWarning` twice.
`get_filename()` now returns before reading or compiling the source.
As a result, a `SyntaxError` in a zipped source module is now raised by
`exec_module()` rather than by `find_spec()` or `get_filename()`, and
the source isn't compiled twice during import, which matches
the filesystem-based loaders.
6 files changed