Skip to content

Commit

Permalink
Sync system site packages on user_site_packages
Browse files Browse the repository at this point in the history
This is what the old virtualenv implementation did, so we match that.
  • Loading branch information
uranusjr authored and frenzymadness committed Jun 15, 2020
1 parent 0a1fd6c commit 14a5ed3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/lib/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,12 @@ def user_site_packages(self):
def user_site_packages(self, value):
self._user_site_packages = value
self._customize_site()

pyvenv_cfg = self.location.joinpath("pyvenv.cfg")
modified_lines = []
for line in pyvenv_cfg.read_text().splitlines():
k, v = line.split("=", 1)
if k.strip() == "include-system-site-packages":
line = "{}= {}".format(k, "true" if value else "false")
modified_lines.append(line)
pyvenv_cfg.write_text("\n".join(modified_lines))

0 comments on commit 14a5ed3

Please sign in to comment.