On Thu, May 11, 2023, 3:02 AM Paolo Bonzini <pbonz...@redhat.com> wrote:
> On 5/11/23 05:54, John Snow wrote: > > + if checkpip(): > > + # We ran ensurepip. We need to re-run post_init...! > > + args = [sys.executable, __file__, "post_init"] > > + subprocess.run(args, check=True) > > + return > > + > > # Finally, generate a 'pip' script so the venv is usable in a > normal > > # way from the CLI. This only happens when we inherited pip from a > > # parent/system-site and haven't run ensurepip in some way. > > Can't this just be: > > + if not checkpip(): > + # Finally, generate a 'pip' script so the venv is usable in a > normal > + # way from the CLI. This only happens when we inherited pip from a > + # parent/system-site and haven't run ensurepip in some way. > + generate_console_scripts(["pip"]) > > even squashed in the original Debian 10 patch? > > You don't need to generate the pip shims if ensurepip has been run. > > Paolo > *cough* You’re completely right. I was so preoccupied on diagnosing why it was failing I didn't even recognize that it wasn't even needed... *facepalm* I'll make that simplifying change, which will also allow me to just put the import in the global scope instead of trying to do it JIT to work around ensurepip shenanigans. Should be a few less "I know this is bad" comments for the linters, too. --js >