summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_module.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_module.py b/Lib/test/test_module.py
index 5a22e69..9da3536 100644
--- a/Lib/test/test_module.py
+++ b/Lib/test/test_module.py
@@ -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.