Skip to content

Commit

Permalink
tools: undefined name opts -> args in gyptest.py
Browse files Browse the repository at this point in the history
```
./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: #30144
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
  • Loading branch information
cclauss authored and targos committed Nov 11, 2019
1 parent 6bc7a6d commit 309c395
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/gyp/gyptest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down

0 comments on commit 309c395

Please sign in to comment.