Skip to content

Commit 96a7a52

Browse files
committed
rebase fixes
1 parent a3f7535 commit 96a7a52

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

babel/core.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def parse(
308308
there is a locale ``en`` that can exist
309309
by itself.
310310
:raise `ValueError`: if the string does not appear to be a valid locale
311-
identifier or ``None`` is passed
311+
identifier
312312
:raise `UnknownLocaleError`: if no locale data is available for the
313313
requested locale
314314
:raise `TypeError`: if the identifier is not a string or a `Locale`
@@ -505,7 +505,7 @@ def get_territory_name(self, locale: Locale | str | None = None) -> str | None:
505505
if locale is None:
506506
locale = self
507507
locale = Locale.parse(locale)
508-
return locale.territories.get(self.territory)
508+
return locale.territories.get(self.territory or '')
509509

510510
territory_name = property(get_territory_name, doc="""\
511511
The localized territory name of the locale if available.
@@ -519,7 +519,7 @@ def get_script_name(self, locale: Locale | str | None = None) -> str | None:
519519
if locale is None:
520520
locale = self
521521
locale = Locale.parse(locale)
522-
return locale.scripts.get(self.script)
522+
return locale.scripts.get(self.script or '')
523523

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

babel/localedata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import re
1919
import sys
2020
import threading
21-
from collections.abc import Iterator, Mapping, MutableMapping
21+
from collections.abc import Iterator, Mapping
2222
from functools import lru_cache
2323
from itertools import chain
2424
from typing import TYPE_CHECKING, Any, MutableMapping, TypeVar

0 commit comments

Comments
 (0)