Skip to content

Commit

Permalink
remove outdated code, fix stdlib path
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Oct 4, 2021
1 parent 6cc2dde commit 7f15291
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/changelog/2182.bugfix.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Fixed path collision that could lead to a PermissionError or writing to system
directories when using PyPy3.8 - by :user:`mgorny`.
Removed outdated PyPy-specific copy of prefix/lib contents, which breaks
when using PyPy3.8 - by :user:`mgorny`.
13 changes: 1 addition & 12 deletions src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PyPy3Posix(PyPy3, PosixSupports):
@property
def stdlib(self):
"""PyPy3 respects sysconfig only for the host python, virtual envs is instead lib/pythonx.y/site-packages"""
return self.dest / "lib" / "python{}".format(self.interpreter.version_release_str) / "site-packages"
return self.dest / "lib" / "pypy{}".format(self.interpreter.version_release_str) / "site-packages"

@classmethod
def _shared_libs(cls):
Expand All @@ -37,17 +37,6 @@ def _shared_libs(cls):
def to_lib(self, src):
return self.dest / "lib" / src.name

@classmethod
def sources(cls, interpreter):
for src in super(PyPy3Posix, cls).sources(interpreter):
yield src
host_lib = Path(interpreter.system_prefix) / "lib"
if host_lib.exists() and host_lib.is_dir():
for path in host_lib.iterdir():
if path.is_dir():
continue
yield PathRefToDest(path, dest=cls.to_lib)


class Pypy3Windows(PyPy3, WindowsSupports):
"""PyPy 2 on Windows"""
Expand Down

0 comments on commit 7f15291

Please sign in to comment.