summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Willmer <alex@moreati.org.uk>2022-01-02 14:58:48 +0000
committerGitHub <noreply@github.com>2022-01-02 14:58:48 +0000
commit50c5591fe9f01dfbc46ceb5638a10b837514410c (patch)
tree63eb49a99663be0680277589edd5ec3eb30130a3 /src
parent319a540001f68b60fd7367e31d5d7398dbd3a1ef (diff)
downloadvirtualenv-50c5591fe9f01dfbc46ceb5638a10b837514410c.tar.gz
fix: AttributeError on macOS creating a Python 2.x virtualenv (#2270)
Diffstat (limited to 'src')
-rw-r--r--src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py b/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py
index 4f7f646..812ec58 100644
--- a/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py
+++ b/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py
@@ -70,7 +70,9 @@ class CPythonmacOsFramework(CPython):
class CPython2macOsFramework(CPythonmacOsFramework, CPython2PosixBase):
@classmethod
def can_create(cls, interpreter):
- return not IS_MAC_ARM64 and super(CPython2macOsFramework, cls).can_describe(interpreter)
+ if not IS_MAC_ARM64 and super(CPython2macOsFramework, cls).can_describe(interpreter):
+ return super(CPython2macOsFramework, cls).can_create(interpreter)
+ return False
@classmethod
def image_ref(cls, interpreter):
@@ -111,7 +113,9 @@ class CPython2macOsFramework(CPythonmacOsFramework, CPython2PosixBase):
class CPython2macOsArmFramework(CPython2macOsFramework, CPythonmacOsFramework, CPython2PosixBase):
@classmethod
def can_create(cls, interpreter):
- return IS_MAC_ARM64 and super(CPythonmacOsFramework, cls).can_describe(interpreter)
+ if IS_MAC_ARM64 and super(CPythonmacOsFramework, cls).can_describe(interpreter):
+ return super(CPythonmacOsFramework, cls).can_create(interpreter)
+ return False
def create(self):
super(CPython2macOsFramework, self).create()