Skip to content
Myr

wrap BASH_VERSION to handle special characters

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Liu Xiteng · committed by David Lord · parent 936b477 · Browse files · 2 files+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+2 added−1 removed

  • other:+2 added−1 removed

2 files+2 added−1 removed

modified:src/click/shell_completion.py+1 added-1 removed
301 unmodified lines
302 def _check_version(self) -> None:303 import subprocess304305 output = subprocess.run(306 ["bash", "-c", "echo ${BASH_VERSION}"], stdout=subprocess.PIPE306 ["bash", "-c", 'echo "${BASH_VERSION}"'], stdout=subprocess.PIPE307 )308 match = re.search(r"^(\d+)\.(\d+)\.\d+", output.stdout.decode())309310 if match is not None:
278 unmodified lines
modified:CHANGES.rst+1 added
9 unmodified lines
10- Improve type hinting for decorators and give all generic types parameters.11 :issue:`2398`12- Fix return value and type signature of `shell_completion.add_completion_class`13 function. :pr:`2421`14- Bash version detection doesn't fail on Windows. :issue:`2461`151617Version 8.1.318-------------
1040 unmodified lines