Skip to content

Commit c403e3d

Browse files
committed
Fix handling of use_known_patches=False
- used to cause an exception
1 parent ca9a356 commit c403e3d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The released versions correspond to PyPi releases.
1212
(see [#627](../../issues/627))
1313
* handle `pathlib.Path.owner()` and `pathlib.Path.group` by returning
1414
the current user/group name (see [#629](../../issues/629))
15+
* fixed handling of `use_known_patches=False` (could cause an exception)
1516

1617
### Infrastructure
1718
* added test dependency check (see [#608](../../issues/608))

pyfakefs/fake_filesystem_unittest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,8 @@ def __init__(self, additional_skip_names: Optional[
485485
for name, fake_module in modules_to_patch.items():
486486
self._fake_module_classes[name] = fake_module
487487
patched_module_names = set(modules_to_patch)
488+
else:
489+
patched_module_names = set()
488490
clear_cache = not use_cache
489491
if use_cache:
490492
if patched_module_names != self.PATCHED_MODULE_NAMES:

0 commit comments

Comments
 (0)