From 5543511f7b4a95ae816be14c768d705fd8362e83 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 27 Oct 2019 13:30:30 +0100 Subject: [PATCH] tools: undefined name opts -> args in gyptest.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` ./tools/gyp/gyptest.py:61:47: F821 undefined name 'opts' extra_path = [os.path.abspath(p) for p in opts.path] ^ ``` `opts.path` is an undefined name in this context while `args.path` is used on the preceding line and is defined on line 48. Undefined names have the potential to raise `NameError` at runtime which will halt the script. PR-URL: https://github.com/nodejs/node/pull/30144 Reviewed-By: Michaƫl Zasso Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Jiawen Geng --- tools/gyp/gyptest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gyp/gyptest.py b/tools/gyp/gyptest.py index 9930e78c7b0f1c..1a9ffca7a134ae 100755 --- a/tools/gyp/gyptest.py +++ b/tools/gyp/gyptest.py @@ -58,7 +58,7 @@ def main(argv=None): os.chdir(args.chdir) if args.path: - extra_path = [os.path.abspath(p) for p in opts.path] + extra_path = [os.path.abspath(p) for p in args.path] extra_path = os.pathsep.join(extra_path) os.environ['PATH'] = extra_path + os.pathsep + os.environ['PATH']