[PATCH] setup: fix a possible NameError on rust build

Georges Racinet georges.racinet at octobus.net
Thu Apr 4 10:24:07 EDT 2019


On 4/4/19 3:43 PM, Philippe Pepiot wrote:
> # HG changeset patch
> # User Philippe Pepiot <philippe.pepiot at logilab.fr>
> # Date 1554385248 -7200
> #      Thu Apr 04 15:40:48 2019 +0200
> # Node ID f7c8453060138de8ab1f56b760d84157d3f0a064
> # Parent  4ee906aa7b60fb6b113e4dc187fbb5a8f42e557c
> setup: fix a possible NameError on rust build
>
>   File "setup.py", line 975, in rustbuild
>     "command: %r, environment: %r" % (self.rustsrcdir, cmd, env))
> NameError: global name 'cmd' is not defined
>
> diff --git a/setup.py b/setup.py
> --- a/setup.py
> +++ b/setup.py
> @@ -1084,7 +1084,7 @@ class RustExtension(Extension):
>          except subprocess.CalledProcessError:
>              raise RustCompilationError(
>                  "Cargo failed. Working directory: %r, "
> -                "command: %r, environment: %r" % (self.rustsrcdir, cmd, env))
> +                "command: %r, environment: %r" % (self.rustsrcdir, cargocmd, env))

Ah yes, indeed that seems right, thanks.

As a side note, I can't get pyflakes (flake8) not pylint to catch this,
even if running explicitely on setup.py; this is a bit puzzling.

-- 
Georges Racinet
https://octobus.net
GPG: BF5456F4DC625443849B6E58EE20CA44EF691D39, sur serveurs publics


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20190404/c4b2f1c2/attachment.sig>


More information about the Mercurial-devel mailing list