mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
fixes issue #1522237, bad init check in _threading_local
This commit is contained in:
parent
b72b0eb357
commit
1ce6136018
2 changed files with 16 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue