# fixhunt regression fixture: ruff UP009, ruff 0.17.1 # the fix labelled safe changes the program's output on this program # before the fix: stdout "line 5", exit 0 # after the fix: stdout "line 4", exit 0 # finding 2026-10-17T21-13-56-323Z-xzoc-ruff-UP009/r2-p006; rule fired 1 time(s) before the fix # -*- coding: utf-8 -*- class DebugCM: def __enter__(self): import inspect self.line = inspect.currentframe().f_lineno return self def __exit__(self, *args): pass def write(self, s): print(s) with DebugCM() as cm: cm.write(f'line {cm.line}')