Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pew resolve workon home lazily #1713

Merged
merged 1 commit into from
Mar 13, 2018
Merged

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Mar 13, 2018

Fix #1682. The problem is that pew resolves workon_home on import time, but we need to patch the lookup logic. This is fine when we run it with pexpect, but not when invoked programmatically. The environment variable WORKON_HOME is changed too late for pew to pick up.

The quick fix is to simply delay importing pew, but it is too unreliable and easy to break again in the future. In the end I decided to just change all workon_home occurrences to function calls, so the value is resolved lazily, and can be patched whenever we want to.

So we can patch the logic before it is resolved. Fix #1682.
@kennethreitz
Copy link
Contributor

👍

@kennethreitz kennethreitz merged commit 50ae99a into master Mar 13, 2018
@kennethreitz kennethreitz deleted the pew-workon-home-override branch March 13, 2018 16:34
@kennethreitz
Copy link
Contributor

released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Virtualenv is not being activated on Windows 10
2 participants