Skip to content

Commit 1183b88

Browse files
Defaulting to running Python version if project .python-version is missing. Otherwise, the integration test fails if we don't specify the version explicitly.
1 parent 316cc4c commit 1183b88

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

integration/local.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import subprocess
2121
import sys
2222
import time
23+
import platform
2324

2425
from watchdog.events import PatternMatchingEventHandler, FileSystemEvent
2526
from watchdog.observers import Observer
@@ -130,8 +131,8 @@ def get_project_python_version() -> str | None:
130131
try:
131132
with open(SCRIPT_DIR.parent / ".python-version", "r") as f:
132133
return f.read().strip()
133-
except:
134-
return None
134+
except FileNotFoundError:
135+
return platform.python_version()
135136

136137

137138
class ChangeHandler(PatternMatchingEventHandler):

0 commit comments

Comments
 (0)