Force unicode when listing module names

pkgutil.iter_modules may return the module name as str instead of unicode on
Python 2.
This commit is contained in:
micbou authored and Dave Halter committed 2018-06-24 22:41:14 +02:00
1 parent 282c6a2ba1
commit 95f835a014
1 file changed
+1 -1
@@ -69,7 +69,7 @@ def get_module_info(evaluator, sys_path=None, full_name=None, **kwargs):
def list_module_names(evaluator, search_path):
return [
name
force_unicode(name)
for module_loader, name, is_pkg in iter_modules(search_path)
]