Skip to content

Commit

Permalink
Fix a couple of type errors
Browse files Browse the repository at this point in the history
One minor, one more significant spotted at:
#200 (comment)

Also rename reused `loader` variable to help avoid false positives.
  • Loading branch information
daviddrysdale committed Sep 2, 2021
1 parent 0f6cbc6 commit 48d4bf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions python/phonenumbers/phonemetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,14 @@ def register_nongeo_region_loader(kls, country_code, loader):
def load_all(kls):
"""Force immediate load of all metadata"""
# Force expansion of contents to lists because we invalidate the iterator
for region_code, loader in list(kls._region_available.items()):
if loader is not None: # pragma no cover
loader(region_code)
for region_code, region_loader in list(kls._region_available.items()):
if region_loader is not None: # pragma no cover
region_loader(region_code)
kls._region_available[region_code] = None
for country_code, loader in list(kls._country_code_available.items()):
if loader is not None:
loader(country_code)
kls._country_code_available[region_code] = None
for country_code, cc_loader in list(kls._country_code_available.items()):
if cc_loader is not None:
cc_loader(country_code)
kls._country_code_available[country_code] = None

@mutating_method
def __init__(self,
Expand Down
2 changes: 1 addition & 1 deletion python/phonenumbers/timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
if (os.path.basename(sys.argv[0]) == "buildmetadatafromxml.py" or
os.path.basename(sys.argv[0]) == "buildprefixdata.py"):
prnt("Failed to import generated data (but OK as during autogeneration)", file=sys.stderr)
TIMEZONE_DATA = {'4411': u('Europe/London')}
TIMEZONE_DATA = {'4411': (u('Europe/London'),)}
TIMEZONE_LONGEST_PREFIX = 4
else:
raise
Expand Down

0 comments on commit 48d4bf1

Please sign in to comment.