Skip to content

Commit a1fd322

Browse files
committed
Add checks for threading.Thread 'args' parameter in the constructor.
1 parent dfa715e commit a1fd322

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/threading.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,10 @@ class is implemented.
909909

910910
self._target = target
911911
self._name = name
912+
913+
if isinstance(args, (str, bytes)) or not hasattr(args, '__iter__'):
914+
raise TypeError(f"'args' must be a non-string iterable like a tuple or list, not {type(args).__name__}")
915+
912916
self._args = args
913917
self._kwargs = kwargs
914918
if daemon is not None:

0 commit comments

Comments
 (0)