summaryrefslogtreecommitdiffstats
path: root/Lib/zoneinfo
diff options
context:
space:
mode:
authorPaul Ganssle <paul@ganssle.io>2020-05-29 13:34:30 (GMT)
committerGitHub <noreply@github.com>2020-05-29 13:34:30 (GMT)
commit364b5ead1584583db91ef7f9d9f87f01bfbb5774 (patch)
tree00b94e01eeca21e816d79a16c31d6bb6e4897e04 /Lib/zoneinfo
parent895c9c1d438367722f74f437fda96767d770662b (diff)
downloadcpython-364b5ead1584583db91ef7f9d9f87f01bfbb5774.zip
cpython-364b5ead1584583db91ef7f9d9f87f01bfbb5774.tar.gz
cpython-364b5ead1584583db91ef7f9d9f87f01bfbb5774.tar.bz2
Further de-linting of zoneinfo module (#20499)
* Remove unused imports in zoneinfo * Remove unused variables in zoneinfo * Remove else after raise
Diffstat (limited to 'Lib/zoneinfo')
-rw-r--r--Lib/zoneinfo/_common.py1
-rw-r--r--Lib/zoneinfo/_tzpath.py3
-rw-r--r--Lib/zoneinfo/_zoneinfo.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/Lib/zoneinfo/_common.py b/Lib/zoneinfo/_common.py
index 3d35d4f..41c898f 100644
--- a/Lib/zoneinfo/_common.py
+++ b/Lib/zoneinfo/_common.py
@@ -80,7 +80,6 @@ def load_data(fobj):
# not by position in the array but by position in the unsplit
# abbreviation string. I suppose this makes more sense in C, which uses
# null to terminate the strings, but it's inconvenient here...
- char_total = 0
abbr_vals = {}
abbr_chars = fobj.read(charcnt)
diff --git a/Lib/zoneinfo/_tzpath.py b/Lib/zoneinfo/_tzpath.py
index 9e381b6..9513611 100644
--- a/Lib/zoneinfo/_tzpath.py
+++ b/Lib/zoneinfo/_tzpath.py
@@ -12,7 +12,8 @@ def reset_tzpath(to=None):
f"tzpaths must be a list or tuple, "
+ f"not {type(tzpaths)}: {tzpaths!r}"
)
- elif not all(map(os.path.isabs, tzpaths)):
+
+ if not all(map(os.path.isabs, tzpaths)):
raise ValueError(_get_invalid_paths_message(tzpaths))
base_tzpath = tzpaths
else:
diff --git a/Lib/zoneinfo/_zoneinfo.py b/Lib/zoneinfo/_zoneinfo.py
index b207dd3..7b1718a 100644
--- a/Lib/zoneinfo/_zoneinfo.py
+++ b/Lib/zoneinfo/_zoneinfo.py
@@ -4,7 +4,7 @@ import collections
import functools
import re
import weakref
-from datetime import datetime, timedelta, timezone, tzinfo
+from datetime import datetime, timedelta, tzinfo
from . import _common, _tzpath