Add pyupgrade pre-commit hook + modernize python code (#2611)
This commit is contained in:
@@ -28,7 +28,7 @@ def detect_os() -> str:
|
||||
system = platform.system()
|
||||
if system == "Linux":
|
||||
try:
|
||||
with open("/proc/version", "r") as f:
|
||||
with open("/proc/version") as f:
|
||||
version_info = f.read().lower()
|
||||
if "microsoft" in version_info:
|
||||
return "wsl"
|
||||
|
||||
@@ -25,5 +25,5 @@ def get_json_from_file(file_path: str) -> dict[str, str]:
|
||||
if not os.path.exists(file_path):
|
||||
return {}
|
||||
|
||||
with open(file_path, "r") as json_file:
|
||||
with open(file_path) as json_file:
|
||||
return json.load(json_file)
|
||||
|
||||
Reference in New Issue
Block a user