diff options
author | Jack Diederich <jackdied@gmail.com> | 2010-02-22 19:55:46 (GMT) |
---|---|---|
committer | Jack Diederich <jackdied@gmail.com> | 2010-02-22 19:55:46 (GMT) |
commit | 561d5aa47f78198a12ff197e0daff55680547d46 (patch) | |
tree | 9f01b4aa6726951f77dc2cab9f4d9c9b8e5821f9 /Lib/test/test_threading_local.py | |
parent | dc8c2adad6af2e3c8cd120cb6498816dc1b5b2d2 (diff) | |
download | cpython-561d5aa47f78198a12ff197e0daff55680547d46.zip cpython-561d5aa47f78198a12ff197e0daff55680547d46.tar.gz cpython-561d5aa47f78198a12ff197e0daff55680547d46.tar.bz2 |
fixes issue #1522237, bad init check in _threading_local
Diffstat (limited to 'Lib/test/test_threading_local.py')
-rw-r--r-- | Lib/test/test_threading_local.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py index f72119b..cd2bed9 100644 --- a/Lib/test/test_threading_local.py +++ b/Lib/test/test_threading_local.py @@ -106,6 +106,21 @@ class ThreadingLocalTest(unittest.TestCase): self.assertTrue(passed) + def test_arguments(self): + # Issue 1522237 + from _thread import _local as local + from _threading_local import local as py_local + + for cls in (local, py_local): + class MyLocal(cls): + def __init__(self, *args, **kwargs): + pass + + MyLocal(a=1) + MyLocal(1) + self.assertRaises(TypeError, cls, a=1) + self.assertRaises(TypeError, cls, 1) + def test_main(): suite = unittest.TestSuite() |