aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrbean-bremen <hansemrbean@googlemail.com>2020-03-03 21:37:09 +0100
committermrbean-bremen <hansemrbean@googlemail.com>2020-03-03 21:37:09 +0100
commitcd55b76db252b090cda8953d34ad470eec40789c (patch)
treebe2f616e24b4b77605fe70c34968b9143c1369a3
parenta51508e5263987bb29dfdeaa8cdc6fbbac1fc139 (diff)
downloadpyfakefs-cd55b76db252b090cda8953d34ad470eec40789c.tar.gz
Ignore any exception that may happen in inspect.getmembers()
- fixes #523
-rw-r--r--CHANGES.md3
-rw-r--r--pyfakefs/fake_filesystem_unittest.py6
2 files changed, 7 insertions, 2 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 807a03a..7109c7c 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -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):