diff --git a/news/252.bugfix.md b/news/252.bugfix.md new file mode 100644 index 0000000000000000000000000000000000000000..79c1eb46a3603691140b04cdad5993c01782fb44 --- /dev/null +++ b/news/252.bugfix.md @@ -0,0 +1 @@ +Strip spaces in user input when prompting for the python version to use. diff --git a/pdm/cli/actions.py b/pdm/cli/actions.py index e9f671bb3e862e8b2e8760ec145bc46cfe29ff4a..b9e436992e1e419ad4141f184b5d37e7ba866a16 100644 --- a/pdm/cli/actions.py +++ b/pdm/cli/actions.py @@ -414,6 +414,7 @@ def do_use(project: Project, python: str, first: bool = False) -> None: """ import pythonfinder + python = python.strip() if python and not all(c.isdigit() for c in python.split(".")): if Path(python).exists(): python_path = find_python_in_path(python)