Skip to content

Commit

Permalink
Merge pull request #19082 from dalthviz/fixes_issue_19000
Browse files Browse the repository at this point in the history
PR: Add regex check for interpreter info output (Programs)
  • Loading branch information
ccordoba12 authored Aug 17, 2022
2 parents 3e37d40 + 262f3e1 commit 3ed374e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spyder/utils/programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,11 @@ def get_interpreter_info(path):
try:
out, __ = run_program(path, ['-V']).communicate()
out = out.decode()

# This is necessary to prevent showing unexpected output.
# See spyder-ide/spyder#19000
if not re.search(r'^Python \d+\.\d+\.\d+$', out):
out = ''
except Exception:
out = ''
return out.strip()
Expand Down

0 comments on commit 3ed374e

Please sign in to comment.