From d501d86b5e974523e965d52001a5c185ce47be92 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 27 Jun 2023 16:08:22 +0200 Subject: python: Add type hints and fix style in rules-cc scripts For maximum compatibility, we use the uppercase types from the typing package instead of the built-in types, therefore compliant with PEP 484 and PEP 526. --- tests/test_rules/test_runner.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/test_rules/test_runner.py') diff --git a/tests/test_rules/test_runner.py b/tests/test_rules/test_runner.py index 976f041..6fd2d8c 100755 --- a/tests/test_rules/test_runner.py +++ b/tests/test_rules/test_runner.py @@ -18,14 +18,14 @@ import os import subprocess import time -time_start = time.time() -time_stop = 0 -result = "UNKNOWN" -stderr = "" -stdout = "" +time_start: float = time.time() +time_stop: float = 0 +result: str = "UNKNOWN" +stderr: str = "" +stdout: str = "" -def dump_results(): +def dump_results() -> None: with open("result", "w") as f: f.write("%s\n" % (result, )) with open("time-start", "w") as f: -- cgit v1.2.3