>
> > they are quite different, in particular the latter has very different
> > (and nicer!) code for detecting the use of virtual environment. Also,
> > comparing hook-site.py,
>
> I simply may have done this wrong :-) I'd appreciate a pull-request for
> how ever it is correct (I assume it's quicker if you are doing this as
> you already worked on this topic). In the commit message, feel free to
> state "This was missed when merging in e886b451."
>
>

I tried to follow the history of compat.py to see where the improvements
were added but could not find it. I will try again to narrow this down to
a single commit.

On the python3-branch, there is commit 12de5e2fd saying "Drop
> fake-site.py and hook-site.py functionality. No need to have fake code
> for site module anymore. Python allows to set run-time flags that just
> ignores the packages from site-packages directory." See
> https://github.com/pyinstaller/pyinstaller/commit/12de5e2fd
>

Thank you for showing this to me. That commit simply deletes
the contents of hook-site.py and the call to it from build.py.
What I see in hook-site.py is not emptiness, but this code,

def hook(mod):
>     if is_venv:
>         # Workaround to get real path of site.py module.
>         if is_win:
>             mod_path = os.path.join(base_prefix, 'Lib', 'site.py')
>         else:
>             mod_path = os.path.join(base_prefix, 'lib',
>                                     'python'+sys.version[:3], 'site.py')
>             mod64_path = os.path.join(base_prefix, 'lib64',
>                                       'python'+sys.version[:3], 'site.py')
>             if os.path.exists(mod64_path):
>                 mod_path = mod64_path
>         mod.retarget(mod_path)
>     return mod
>

There are multiple problems with this. The first is, where did it
come from? Does it predate the code that substituted
fake-site.py for real site.py (and was removed by #12de5)?

It uses uses compat.is_venv and .base_prefix; these names
are not set in in Develop branch's version of compat.py. So it
predates whatever commit improved compat.py.

I will persist in trying to track this down and report later.
But if anyone has an idea, please speak up.

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

Reply via email to