Patchwork [4,of,4] py3: fix a syntax error in concurrent.futures._base

login
register
mail settings
Submitter Matt Harbison
Date Sept. 13, 2018, 9:44 p.m.
Message ID <21b7873d62322737c585.1536875056@mharbison-pc.attotech.com>
Download mbox | patch
Permalink /patch/34630/
State Accepted
Headers show

Comments

Matt Harbison - Sept. 13, 2018, 9:44 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1536874569 14400
#      Thu Sep 13 17:36:09 2018 -0400
# Node ID 21b7873d62322737c5850d07162fe8fdaf98fbf5
# Parent  9fa7b40298e9759ae76b9272a26dda00aa3b9a6e
py3: fix a syntax error in concurrent.futures._base

3.7.0 on Windows complained about this.  Not sure if there's a better way,
because check-code bans the two arg form of this.
Yuya Nishihara - Sept. 13, 2018, 10:51 p.m.
On Thu, 13 Sep 2018 17:44:16 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1536874569 14400
> #      Thu Sep 13 17:36:09 2018 -0400
> # Node ID 21b7873d62322737c5850d07162fe8fdaf98fbf5
> # Parent  9fa7b40298e9759ae76b9272a26dda00aa3b9a6e
> py3: fix a syntax error in concurrent.futures._base

Queued the first three, thanks.

This is vendored code, and unused on Python 3. It's probably better not
touching.
Gregory Szorc - Sept. 13, 2018, 11:11 p.m.
On Thu, Sep 13, 2018 at 3:52 PM Yuya Nishihara <yuya@tcha.org> wrote:

> On Thu, 13 Sep 2018 17:44:16 -0400, Matt Harbison wrote:
> > # HG changeset patch
> > # User Matt Harbison <matt_harbison@yahoo.com>
> > # Date 1536874569 14400
> > #      Thu Sep 13 17:36:09 2018 -0400
> > # Node ID 21b7873d62322737c5850d07162fe8fdaf98fbf5
> > # Parent  9fa7b40298e9759ae76b9272a26dda00aa3b9a6e
> > py3: fix a syntax error in concurrent.futures._base
>
> Queued the first three, thanks.
>
> This is vendored code, and unused on Python 3. It's probably better not
> touching.
>

Correct. This package should not be imported on Python 3. If it is, then
that's a bug.
Matt Harbison - Sept. 13, 2018, 11:46 p.m.
> On Sep 13, 2018, at 7:11 PM, Gregory Szorc <gregory.szorc@gmail.com> wrote:
> 
>> On Thu, Sep 13, 2018 at 3:52 PM Yuya Nishihara <yuya@tcha.org> wrote:
>> On Thu, 13 Sep 2018 17:44:16 -0400, Matt Harbison wrote:
>> > # HG changeset patch
>> > # User Matt Harbison <matt_harbison@yahoo.com>
>> > # Date 1536874569 14400
>> > #      Thu Sep 13 17:36:09 2018 -0400
>> > # Node ID 21b7873d62322737c5850d07162fe8fdaf98fbf5
>> > # Parent  9fa7b40298e9759ae76b9272a26dda00aa3b9a6e
>> > py3: fix a syntax error in concurrent.futures._base
>> 
>> Queued the first three, thanks.
>> 
>> This is vendored code, and unused on Python 3. It's probably better not
>> touching.
> 
> Correct. This package should not be imported on Python 3. If it is, then that's a bug. 

`make local` printed the error (otherwise I wouldn’t have seen it), but it kept going.  It looks like the py3 test bot doesn’t do `make local`, so IDK if this is just a Windows issue.  Not sure if this would be compiled if it isn’t imported.  Maybe that dependency walker isn’t paying attention to conditionals around the imports?

Patch

diff --git a/mercurial/thirdparty/concurrent/futures/_base.py b/mercurial/thirdparty/concurrent/futures/_base.py
--- a/mercurial/thirdparty/concurrent/futures/_base.py
+++ b/mercurial/thirdparty/concurrent/futures/_base.py
@@ -413,7 +413,7 @@  class Future(object):
                 exception_type = self._exception.__class__
             else:
                 exception_type = type(self._exception)
-            raise exception_type, self._exception, self._traceback
+            raise (exception_type, self._exception, self._traceback)
         else:
             return self._result