diff options
author | mrbean-bremen <hansemrbean@googlemail.com> | 2020-03-03 21:37:09 +0100 |
---|---|---|
committer | mrbean-bremen <hansemrbean@googlemail.com> | 2020-03-03 21:37:09 +0100 |
commit | cd55b76db252b090cda8953d34ad470eec40789c (patch) | |
tree | be2f616e24b4b77605fe70c34968b9143c1369a3 | |
parent | a51508e5263987bb29dfdeaa8cdc6fbbac1fc139 (diff) | |
download | pyfakefs-cd55b76db252b090cda8953d34ad470eec40789c.tar.gz |
Ignore any exception that may happen in inspect.getmembers()
- fixes #523
-rw-r--r-- | CHANGES.md | 3 | ||||
-rw-r--r-- | pyfakefs/fake_filesystem_unittest.py | 6 |
2 files changed, 7 insertions, 2 deletions
@@ -3,6 +3,9 @@ The released versions correspond to PyPi releases. ## Version 4.1.0 (as yet unreleased) +#### Fixes + * Avoid exception if using `flask-restx` (see [#523](../../issues/523)) + ## [Version 4.0.0](https://pypi.python.org/pypi/pyfakefs/4.0.0) * pyfakefs 4.0.0 drops support for Python 2.7. If you still need diff --git a/pyfakefs/fake_filesystem_unittest.py b/pyfakefs/fake_filesystem_unittest.py index 9587e75..dbb2e34 100644 --- a/pyfakefs/fake_filesystem_unittest.py +++ b/pyfakefs/fake_filesystem_unittest.py @@ -509,8 +509,10 @@ class Patcher: for i, d in enumerate(m.__defaults__): if self._is_fs_function(d): yield m, i, d - except ImportError: - # Ignore ImportError: No module named '_gdbm' + except Exception: + # Ignore any exception, examples: + # ImportError: No module named '_gdbm' + # _DontDoThat() (see #523) pass def _find_modules(self): |