Skip to content

Commit d1a2fad

Browse files
authored
Fix keyerror when reloading modules (#282)
This commit teaches `get_package_modules()` to return a list instead of a generator object, to ensure a static list of names is used to unload modules from cache. That's a follow up of 9df1177, which obviously didn't fix the issue sufficiently enough.
1 parent 9b5c688 commit d1a2fad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

unittesting/reloader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ def module_in_package(module):
3535
or any(map(in_package_path, paths))
3636
)
3737

38-
return (
38+
return [
3939
name
40-
for name, module in tuple(sys.modules.items())
40+
for name, module in sys.modules.items()
4141
if module_in_package(module)
42-
)
42+
]
4343

4444

4545
def package_plugins(pkg_name):

0 commit comments

Comments
 (0)