[PATCH 2 of 2] py3: roll up threading.Thread constructor args into **kwargs

Boris FELD boris.feld at octobus.net
Fri Oct 26 04:05:00 EDT 2018


LGTM.

I couldn't find any code that was passing those arguments and as the
class is local to the `_windowsworker` function, can we remove the
support for those arguments?

On 26/10/2018 04:41, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1540520002 14400
> #      Thu Oct 25 22:13:22 2018 -0400
> # Node ID 434a43635f1df4375081cd6820c255ecf8ea22ad
> # Parent  d69cf134bd50c0891d205000c00aed4e028c9f1d
> py3: roll up threading.Thread constructor args into **kwargs
>
> The constructor doesn't have a `verbose` keyword argument in py3.
>
> diff --git a/mercurial/worker.py b/mercurial/worker.py
> --- a/mercurial/worker.py
> +++ b/mercurial/worker.py
> @@ -250,10 +250,9 @@ def _posixexitstatus(code):
>  
>  def _windowsworker(ui, func, staticargs, args):
>      class Worker(threading.Thread):
> -        def __init__(self, taskqueue, resultqueue, func, staticargs,
> -                     group=None, target=None, name=None, verbose=None):
> -            threading.Thread.__init__(self, group=group, target=target,
> -                                      name=name, verbose=verbose)
> +        def __init__(self, taskqueue, resultqueue, func, staticargs, *args,
> +                     **kwargs):
> +            threading.Thread.__init__(self, *args, **kwargs)
>              self._taskqueue = taskqueue
>              self._resultqueue = resultqueue
>              self._func = func
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list