[issue45156] mock.seal has infinite recursion with int class attributes

Nikita Sobolev report at bugs.python.org
Mon Sep 13 07:01:50 EDT 2021


Nikita Sobolev <mail at sobolevn.me> added the comment:

I've proposed a solution, based on the assumption that we don't need to recurse into `_SpecState` props:

```
if isinstance(m._mock_children.get(attr), _SpecState):
   continue
```

It seems like a simple and reasonable thing to do.
Link: https://github.com/python/cpython/pull/28300

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45156>
_______________________________________


More information about the Python-bugs-list mailing list