bpo-35119: Fix RecursionError in example of customizing module attribute access. (GH-10323)

https://bugs.python.org/issue35119
(cherry picked from commit 0bee3c36d4)

Co-authored-by: Denis Osipov <osipov_d@list.ru>
This commit is contained in:
Miss Islington (bot) 2018-11-05 17:59:15 -08:00 committed by GitHub
parent 91a19c923c
commit 558dc8adbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1580,7 +1580,7 @@ a module object to a subclass of :class:`types.ModuleType`. For example::
def __setattr__(self, attr, value):
print(f'Setting {attr}...')
setattr(self, attr, value)
super().__setattr__(attr, value)
sys.modules[__name__].__class__ = VerboseModule