Skip to content

Commit

Permalink
Fixed unnecessary instantiating of FakeModule
Browse files Browse the repository at this point in the history
  • Loading branch information
Mandera committed May 20, 2023
1 parent 8506b94 commit f82ac62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generalimport/fake_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def __getattr__(self, item):
fakemodule = FakeModule(spec=self.__spec__, trigger=item)
if self._item_is_exception(item=item) or self._item_is_dunder(item=item):
fakemodule.error_func(item)
return FakeModule(spec=self.__spec__, trigger=item)
return fakemodule


# Sets all the callable dunders of FakeModule to 'error_func()' by preserving the name of the dunder that triggered it.
Expand Down

0 comments on commit f82ac62

Please sign in to comment.