mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
do not override errors from descriptors on modules
This commit is contained in:
parent
7b9ff0e6da
commit
1184e266b9
2 changed files with 17 additions and 10 deletions
|
@ -227,6 +227,14 @@ a = A(destroyed)"""
|
|||
b"len = len",
|
||||
b"shutil.rmtree = rmtree"})
|
||||
|
||||
def test_descriptor_errors_propogate(self):
|
||||
class Descr:
|
||||
def __get__(self, o, t):
|
||||
raise RuntimeError
|
||||
class M(ModuleType):
|
||||
melon = Descr()
|
||||
self.assertRaises(RuntimeError, getattr, M("mymod"), "melon")
|
||||
|
||||
# frozen and namespace module reprs are tested in importlib.
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue