Further de-linting of zoneinfo module (#20499) · python/cpython@364b5ea

Original file line numberDiff line numberDiff line change

@@ -19,12 +19,7 @@

1919

from functools import cached_property

2020
2121

from . import _support as test_support

22-

from ._support import (

23-

OS_ENV_LOCK,

24-

TZPATH_LOCK,

25-

TZPATH_TEST_LOCK,

26-

ZoneInfoTestBase,

27-

)

22+

from ._support import OS_ENV_LOCK, TZPATH_TEST_LOCK, ZoneInfoTestBase

2823
2924

py_zoneinfo, c_zoneinfo = test_support.get_modules()

3025

@@ -365,7 +360,6 @@ def test_folds_and_gaps(self):

365360

self.assertEqual(dt.dst(), offset.dst, dt)

366361
367362

def test_folds_from_utc(self):

368-

tests = []

369363

for key in self.zones():

370364

zi = self.zone_from_key(key)

371365

with self.subTest(key=key):

@@ -927,7 +921,7 @@ def populate_tzstr_header(cls):

927921

# the Version 2+ file. In this case, we have no transitions, just

928922

# the tzstr in the footer, so up to the footer, the files are

929923

# identical and we can just write the same file twice in a row.

930-

for i in range(2):

924+

for _ in range(2):

931925

out += b"TZif" # Magic value

932926

out += b"3" # Version

933927

out += b" " * 15 # Reserved

@@ -952,7 +946,6 @@ def zone_from_tzstr(self, tzstr):

952946

return self.klass.from_file(zonefile, key=tzstr)

953947
954948

def test_tzstr_localized(self):

955-

i = 0

956949

for tzstr, cases in self.test_cases.items():

957950

with self.subTest(tzstr=tzstr):

958951

zi = self.zone_from_tzstr(tzstr)