Skip to content
Prev Previous commit
Next Next commit
Correct Lint error
  • Loading branch information
VanshAgarwal24036 committed Jan 20, 2026
commit 281077dee4e27d5af9cfdb7365d64ef02b3c253b
9 changes: 4 additions & 5 deletions Lib/test/test_datetime.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest
import sys
import functools
import importlib.util

from test.support.import_helper import import_fresh_module

Expand All @@ -13,11 +14,9 @@ def load_tests(loader, tests, pattern):
fresh=['datetime', '_pydatetime', '_strptime'],
blocked=['_datetime'],
)
try:
import _datetime
has_datetime = True
except ImportError:
has_datetime = False

# Check availability without importing _datetime
has_datetime = importlib.util.find_spec('_datetime') is not None
Comment thread
VanshAgarwal24036 marked this conversation as resolved.
Outdated

fast_tests = import_fresh_module(
TESTS,
Expand Down
Loading