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

Philippe Pepiot philippe.pepiot at logilab.fr
Thu Apr 4 09:43:44 EDT 2019


# 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))
 
 class RustEnhancedExtension(RustExtension):
     """A C Extension, conditionally enhanced with Rust code.


More information about the Mercurial-devel mailing list