summaryrefslogtreecommitdiff
path: root/poky/meta/lib/oe/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/lib/oe/package.py')
-rw-r--r--poky/meta/lib/oe/package.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/poky/meta/lib/oe/package.py b/poky/meta/lib/oe/package.py
index d1738d3b61..587810bdaf 100644
--- a/poky/meta/lib/oe/package.py
+++ b/poky/meta/lib/oe/package.py
@@ -652,11 +652,15 @@ def split_locales(d):
locales = set()
for localepath in (d.getVar('LOCALE_PATHS') or "").split():
localedir = dvar + localepath
- if cpath.isdir(localedir):
- locales.update(os.listdir(localedir))
- localepaths.append(localepath)
- else:
- bb.debug(1, "No locale files in %s" % localepath)
+ if not cpath.isdir(localedir):
+ bb.debug(1, 'No locale files in %s' % localepath)
+ continue
+
+ localepaths.append(localepath)
+ with os.scandir(localedir) as it:
+ for entry in it:
+ if entry.is_dir():
+ locales.add(entry.name)
if len(locales) == 0:
bb.debug(1, "No locale files in this package")