summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading_local.py
diff options
context:
space:
mode:
authorJack Diederich <jackdied@gmail.com>2010-02-22 19:55:22 (GMT)
committerJack Diederich <jackdied@gmail.com>2010-02-22 19:55:22 (GMT)
commit1ce6136018b6e1447368e1cc9ec3b70b0dd8729d (patch)
tree07e5df5c148950d9e67015e359c660e477a41492 /Lib/test/test_threading_local.py
parentb72b0eb357e9237e9de95dadda18fda433f88aac (diff)
downloadcpython-1ce6136018b6e1447368e1cc9ec3b70b0dd8729d.zip
cpython-1ce6136018b6e1447368e1cc9ec3b70b0dd8729d.tar.gz
cpython-1ce6136018b6e1447368e1cc9ec3b70b0dd8729d.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.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py
index 93ec12b..ab3b358 100644
--- a/Lib/test/test_threading_local.py
+++ b/Lib/test/test_threading_local.py
@@ -105,6 +105,21 @@ class ThreadingLocalTest(unittest.TestCase):
self.assertTrue(passed[0])
+ 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()