From 6a82aef05bf02a684669e69f0bb803fe9a909262 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 26 Jul 2026 17:42:42 +0200 Subject: scripts: various ruff fixes * ruff 0.16.0 * python 3.14.6 --- scripts/benchmark.py | 7 +++---- scripts/generate-alt-random-writes.py | 4 +--- scripts/generate-emoji-variation-sequences.py | 0 scripts/srgb.py | 1 - 4 files changed, 4 insertions(+), 8 deletions(-) mode change 100644 => 100755 scripts/generate-emoji-variation-sequences.py diff --git a/scripts/benchmark.py b/scripts/benchmark.py index fe820d9b..8f161fbe 100755 --- a/scripts/benchmark.py +++ b/scripts/benchmark.py @@ -7,8 +7,7 @@ import statistics import struct import sys import termios - -from datetime import datetime +from datetime import UTC, datetime def main() -> None: @@ -30,9 +29,9 @@ def main() -> None: bench_bytes = f.read() for _ in range(args.iterations): - start = datetime.now() + start = datetime.now(tz=UTC) sys.stdout.buffer.write(bench_bytes) - stop = datetime.now() + stop = datetime.now(tz=UTC) times[f.name].append((stop - start).total_seconds()) diff --git a/scripts/generate-alt-random-writes.py b/scripts/generate-alt-random-writes.py index 7ad1460c..bebe4b0e 100755 --- a/scripts/generate-alt-random-writes.py +++ b/scripts/generate-alt-random-writes.py @@ -7,7 +7,6 @@ import signal import struct import sys import termios - from typing import Any @@ -50,7 +49,6 @@ def main() -> None: def dummy(*args: Any) -> None: """Need a handler installed for sigwait() to trigger.""" _ = args - pass signal.signal(signal.SIGWINCH, dummy) while True: @@ -90,7 +88,7 @@ def main() -> None: width = 8 * cols # PGO help binary hardcodes cell width to 8px if lines is None or cols is None or height is None or width is None: - raise Exception('could not get terminal width/height; use --rows and --cols') + raise ValueError('could not get terminal width/height; use --rows and --cols') assert lines > 0, f'{lines}' assert cols > 0, f'{cols}' diff --git a/scripts/generate-emoji-variation-sequences.py b/scripts/generate-emoji-variation-sequences.py old mode 100644 new mode 100755 diff --git a/scripts/srgb.py b/scripts/srgb.py index a6aa0f4a..fb718bcf 100755 --- a/scripts/srgb.py +++ b/scripts/srgb.py @@ -3,7 +3,6 @@ import argparse import math - # Note: we use a pure gamma 2.2 function, rather than the piece-wise # sRGB transfer function, since that is what all compositors do. -- cgit v1.3