Skip to content

Commit 053c242

Browse files
committed
Type fixes from 961
1 parent 9b67367 commit 053c242

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

babel/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def get_territory_name(self, locale: Locale | str | None = None) -> str | None:
503503
if locale is None:
504504
locale = self
505505
locale = Locale.parse(locale)
506-
return locale.territories.get(self.territory)
506+
return locale.territories.get(self.territory or '')
507507

508508
territory_name = property(get_territory_name, doc="""\
509509
The localized territory name of the locale if available.
@@ -517,7 +517,7 @@ def get_script_name(self, locale: Locale | str | None = None) -> str | None:
517517
if locale is None:
518518
locale = self
519519
locale = Locale.parse(locale)
520-
return locale.scripts.get(self.script)
520+
return locale.scripts.get(self.script or '')
521521

522522
script_name = property(get_script_name, doc="""\
523523
The localized script name of the locale if available.

0 commit comments

Comments
 (0)