Skip to content

Commit b97b96d

Browse files
thefourtheyeFishrock123
authored andcommitted
install: fix NameError
If `len(args)` is less than two, then `install_path = dst_dir + node_prefix + '/'` would throw a `NameError`, because `dst_dir` will not be defined yet. So we are assigning `''` as the default value. PR-URL: #1628 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent c43855c commit b97b96d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/install.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ def run(args):
198198
# argv[2] is a custom install prefix for packagers (think DESTDIR)
199199
# argv[3] is a custom install prefix (think PREFIX)
200200
# Difference is that dst_dir won't be included in shebang lines etc.
201-
if len(args) > 2:
202-
dst_dir = args[2]
201+
dst_dir = args[2] if len(args) > 2 else ''
202+
203203
if len(args) > 3:
204204
node_prefix = args[3]
205205

0 commit comments

Comments
 (0)