bpo-31975 (PEP 565): Show DeprecationWarning in main by ncoghlan · Pull Request #4458 · python/cpython (original) (raw)

I worked out why the new test was passing even though I hadn't updated the pure Python implementation: the pure Python version wasn't configuring the new __main__ filter at all, and the tests were instead checking the C accelerated implementation twice. So I've tweaked that test case to make sure that the subprocess uses the pure Python implementation when that's the version being tested (unlike the C accelerated version, it uses a regex like normal, since it uses the public module API to add the filters). I've also updated the test case to account for the empty default filter list in Py_DEBUG builds.

The PR has been rebased on the current master branch, and I've fixed the issue reference to point to the right place.