summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_module.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-04-24 23:29:23 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-04-24 23:29:23 (GMT)
commit1184e266b92b2b9b5effccd570024c72de1363fe (patch)
tree9de0f9a1b726f8b50a6b255ddb51201bdd7af6f3 /Lib/test/test_module.py
parent7b9ff0e6da5371214b29053cdb96218e0d2eb655 (diff)
downloadcpython-1184e266b92b2b9b5effccd570024c72de1363fe.zip
cpython-1184e266b92b2b9b5effccd570024c72de1363fe.tar.gz
cpython-1184e266b92b2b9b5effccd570024c72de1363fe.tar.bz2
do not override errors from descriptors on modules
Diffstat (limited to 'Lib/test/test_module.py')
-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.