From 5db183092e980a208a1e24aa238e7740b1304770 Mon Sep 17 00:00:00 2001 From: frostming Date: Wed, 22 Jan 2020 16:45:44 +0800 Subject: [PATCH] Mistakenly stripped the leading "C" Fix #5 --- pdm/installers.py | 2 +- pdm/utils.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pdm/installers.py b/pdm/installers.py index 1e4f2a4f..f594b2a0 100644 --- a/pdm/installers.py +++ b/pdm/installers.py @@ -79,7 +79,7 @@ class Installer: paths = self.environment.get_paths() install_script = importlib.import_module( "pdm._editable_install" - ).__file__.strip("co") + ).__file__.rstrip("co") install_args = [ self.environment.python_executable, "-u", diff --git a/pdm/utils.py b/pdm/utils.py index 8a4f3e9f..01bc3f92 100644 --- a/pdm/utils.py +++ b/pdm/utils.py @@ -334,9 +334,7 @@ def get_python_version(executable: str) -> Tuple[Union[str, int], ...]: def get_pep508_environment(executable: str) -> Dict[str, Any]: - script = importlib.import_module("pdm.pep508").__file__ - if script.endswith("pyc"): - script = script[:-1] + script = importlib.import_module("pdm.pep508").__file__.rstrip("co") args = [executable, script] return json.loads(subprocess.check_output(args)) -- GitLab