bpo-39336: Allow packages to not let their child modules be set on them (#18006)

* bpo-39336: Allow setattr to fail on modules which aren't assignable

When attaching a child module to a package if the object in sys.modules raises an AttributeError (e.g. because it is immutable) it causes the whole import to fail.  This now allows immutable packages to exist and an ImportWarning is reported and the AttributeError exception is ignored.
This commit is contained in:
Dino Viehland 2020-01-22 16:42:38 -08:00 committed by GitHub
parent d3ae95e1e9
commit 9b6fec4651
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 379 additions and 338 deletions