mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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:
parent
d3ae95e1e9
commit
9b6fec4651
6 changed files with 379 additions and 338 deletions
0
Lib/test/test_import/data/unwritable/x.py
Normal file
0
Lib/test/test_import/data/unwritable/x.py
Normal file
Loading…
Add table
Add a link
Reference in a new issue