Skip to content

Commit cff8de2

Browse files
committed
Avoid generators. Saves 70usec.
1 parent 969e955 commit cff8de2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

importlib_metadata/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,10 @@ def joinpath(self, child):
399399

400400
def children(self):
401401
with suppress(Exception):
402-
yield from os.listdir(self.root or '')
402+
return os.listdir(self.root or '')
403403
with suppress(Exception):
404-
yield from self.zip_children()
404+
return self.zip_children()
405+
return []
405406

406407
def zip_children(self):
407408
zip_path = zipp.Path(self.root)

0 commit comments

Comments
 (0)