Skip to content

Commit 8f2bcab

Browse files
Delete a broken threading.local example (GH-5870)
This code never did anything correct or useful. The class attribute will never be affected, and the condition will never be true. (cherry picked from commit 5fb632e) Co-authored-by: Aaron Gallagher <habnabit@users.noreply.github.com>
1 parent a79591c commit 8f2bcab

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Lib/_threading_local.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@
5656
5757
>>> class MyLocal(local):
5858
... number = 2
59-
... initialized = False
6059
... def __init__(self, **kw):
61-
... if self.initialized:
62-
... raise SystemError('__init__ called too many times')
63-
... self.initialized = True
6460
... self.__dict__.update(kw)
6561
... def squared(self):
6662
... return self.number ** 2
@@ -97,7 +93,7 @@
9793
>>> thread.start()
9894
>>> thread.join()
9995
>>> log
100-
[[('color', 'red'), ('initialized', True)], 11]
96+
[[('color', 'red')], 11]
10197
10298
without affecting this thread's data:
10399

0 commit comments

Comments
 (0)