fix: remove unused _ORIGINAL_MONOTONIC and add tz type annotation
Some checks are pending
Claude Code / pr-review (pull_request) Waiting to run
Claude Code / claude-mention (pull_request) Waiting to run
CodeFlash / Optimize new Python code (pull_request) Waiting to run
E2E - Async / async-optimization (pull_request) Waiting to run
E2E - Bubble Sort Benchmark / benchmark-bubble-sort-optimization (pull_request) Waiting to run
E2E - Bubble Sort Pytest (No Git) / bubble-sort-optimization-pytest-no-git (pull_request) Waiting to run
E2E - Bubble Sort Unittest / bubble-sort-optimization-unittest (pull_request) Waiting to run
Coverage E2E / end-to-end-test-coverage (pull_request) Waiting to run
E2E - Futurehouse Structure / futurehouse-structure (pull_request) Waiting to run
E2E - Init Optimization / init-optimization (pull_request) Waiting to run
E2E - JS CommonJS Function / js-cjs-function-optimization (pull_request) Waiting to run
E2E - JS ESM Async / js-esm-async-optimization (pull_request) Waiting to run
E2E - JS TypeScript Class / js-ts-class-optimization (pull_request) Waiting to run
E2E - Topological Sort (Worktree) / topological-sort-worktree-optimization (pull_request) Waiting to run
E2E - Tracer Replay / tracer-replay (pull_request) Waiting to run
PR Labeler / label-workflow-changes (pull_request) Waiting to run
Mypy Type Checking for CLI / type-check-cli (pull_request) Waiting to run
Lint / prek (pull_request) Waiting to run
unit-tests / unit-tests (ubuntu-latest, 3.12) (pull_request) Waiting to run
unit-tests / unit-tests (ubuntu-latest, 3.10) (pull_request) Waiting to run
unit-tests / unit-tests (ubuntu-latest, 3.11) (pull_request) Waiting to run
unit-tests / unit-tests (ubuntu-latest, 3.13) (pull_request) Waiting to run
unit-tests / unit-tests (ubuntu-latest, 3.14) (pull_request) Waiting to run
unit-tests / unit-tests (ubuntu-latest, 3.9) (pull_request) Waiting to run
unit-tests / unit-tests (windows-latest, 3.13) (pull_request) Waiting to run

Co-authored-by: Aseem Saxena <undefined@users.noreply.github.com>
This commit is contained in:
claude[bot] 2026-03-12 20:34:12 +00:00
parent cea2653509
commit 756eab93be

View file

@ -92,7 +92,6 @@ _ORIGINAL_TIME_TIME = _time_module.time
_ORIGINAL_PERF_COUNTER = _time_module.perf_counter
_ORIGINAL_PERF_COUNTER_NS = _time_module.perf_counter_ns
_ORIGINAL_TIME_SLEEP = _time_module.sleep
_ORIGINAL_MONOTONIC = _time_module.monotonic
_DETERMINISTIC_PATCHES_APPLIED = False
@ -173,7 +172,7 @@ def _apply_deterministic_patches() -> None:
# Patch datetime.datetime with a subclass that overrides now() and utcnow()
class DeterministicDatetime(datetime.datetime):
@classmethod
def now(cls, tz=None) -> datetime.datetime:
def now(cls, tz: datetime.tzinfo | None = None) -> datetime.datetime:
if tz is None:
return fixed_datetime.replace(tzinfo=None)
return fixed_datetime.astimezone(tz)