summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIsac Byeonghoon Yoo <bh322yoo@gmail.com>2022-02-05 20:59:10 +0900
committerGitHub <noreply@github.com>2022-02-05 11:59:10 +0000
commitf969a91240e29eace6b7ddcc390bb1553027a483 (patch)
treea58afaf1091ff2b25665faba4be7bcfffe3cc5f2 /src
parent5dde2d8b3caf1ae9391e54c6b83a97c1340d4ca3 (diff)
downloadvirtualenv-f969a91240e29eace6b7ddcc390bb1553027a483.tar.gz
fix: cast type from Path to text (#2288)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py9
1 files changed, 5 insertions, 4 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 d5f2463..6024c97 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
@@ -7,7 +7,7 @@ import subprocess
from abc import ABCMeta, abstractmethod
from textwrap import dedent
-from six import add_metaclass
+from six import add_metaclass, text_type
from virtualenv.create.via_global_ref.builtin.ref import ExePathRefToDest, PathRefToDest, RefMust
from virtualenv.info import IS_MAC_ARM64
@@ -134,10 +134,11 @@ class CPython2macOsArmFramework(CPython2macOsFramework, CPythonmacOsFramework, C
# Reset the signing on Darwin since the exe has been modified.
# Note codesign fails on the original exe, it needs to be copied and moved back.
bak_dir.mkdir(parents=True, exist_ok=True)
- subprocess.check_call(["cp", exe, bak_dir])
- subprocess.check_call(["mv", bak_dir / exe.name, exe])
+ subprocess.check_call(["cp", text_type(exe), text_type(bak_dir)])
+ subprocess.check_call(["mv", text_type(bak_dir / exe.name), text_type(exe)])
bak_dir.rmdir()
- cmd = ["codesign", "-s", "-", "--preserve-metadata=identifier,entitlements,flags,runtime", "-f", exe]
+ metadata = "--preserve-metadata=identifier,entitlements,flags,runtime"
+ cmd = ["codesign", "-s", "-", metadata, "-f", text_type(exe)]
logging.debug("Changing Signature: %s", cmd)
subprocess.check_call(cmd)
except Exception: