summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/locale_database/ldml.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/util/locale_database/ldml.py b/util/locale_database/ldml.py
index 3899c94109..eaf5d66f65 100644
--- a/util/locale_database/ldml.py
+++ b/util/locale_database/ldml.py
@@ -219,9 +219,7 @@ class LocaleScanner (object):
for elt in self.__find(xpath):
try:
if draft is None or elt.draft <= draft:
- value = elt.dom.firstChild.nodeValue
- if value != INHERIT:
- return value
+ return elt.dom.firstChild.nodeValue
except (AttributeError, KeyError):
pass
except Error as e:
@@ -432,6 +430,7 @@ class LocaleScanner (object):
break
else: # Found matching elements
+ elts = tuple(self.__skipInheritors(elts))
if elts:
foundNone = False
# Possibly filter elts to prefer the least drafty ?
@@ -460,6 +459,7 @@ class LocaleScanner (object):
raise Error(f'All lack child {selector} for {sought} in {self.name}')
else: # Found matching elements
+ roots = tuple(self.__skipInheritors(roots))
if roots:
foundNone = False
for elt in roots:
@@ -471,6 +471,15 @@ class LocaleScanner (object):
sought += f' (for {xpath})'
raise Error(f'No {sought} in {self.name}')
+ @staticmethod
+ def __skipInheritors(elts):
+ for elt in elts:
+ try:
+ if elt.dom.firstChild.nodeValue != INHERIT:
+ yield elt
+ except (AttributeError, KeyError):
+ yield elt
+
def __currencyDisplayName(self, stem):
try:
return self.find(stem + 'displayName')