Fix raise-within-try in language util (#123354)

This commit is contained in:
epenet 2024-08-08 18:51:19 +02:00 committed by GitHub
parent ddc94030a6
commit b498c89860
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -137,9 +137,6 @@ class Dialect:
region_idx = pref_regions.index(self.region)
elif dialect.region is not None:
region_idx = pref_regions.index(dialect.region)
else:
# Can't happen, but mypy is not smart enough
raise ValueError
# More preferred regions are at the front.
# Add 1 to boost above a weak match where no regions are set.