summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-03-26 23:18:09 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-03-26 23:18:09 (GMT)
commiteb2389be0e00551d42ddd5eaa89adef8eb48c8dd (patch)
tree54a10b5b56a1aa1d40aeb823a38e57015541951f /Lib/ctypes/test
parentb04d70d993d3aec544a8dc552ca1b36e3fae730c (diff)
parent1a07f07337dc722b9d6f347944abca4c8fbf5f02 (diff)
downloadcpython-eb2389be0e00551d42ddd5eaa89adef8eb48c8dd.zip
cpython-eb2389be0e00551d42ddd5eaa89adef8eb48c8dd.tar.gz
cpython-eb2389be0e00551d42ddd5eaa89adef8eb48c8dd.tar.bz2
merge 3.2
Diffstat (limited to 'Lib/ctypes/test')
-rw-r--r--Lib/ctypes/test/test_as_parameter.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_as_parameter.py b/Lib/ctypes/test/test_as_parameter.py
index 835398f..475d595 100644
--- a/Lib/ctypes/test/test_as_parameter.py
+++ b/Lib/ctypes/test/test_as_parameter.py
@@ -187,6 +187,18 @@ class BasicWrapTestCase(unittest.TestCase):
self.assertEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h),
(9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9))
+ def test_recursive_as_param(self):
+ from ctypes import c_int
+
+ class A(object):
+ pass
+
+ a = A()
+ a._as_parameter_ = a
+ with self.assertRaises(RuntimeError):
+ c_int.from_param(a)
+
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class AsParamWrapper(object):