From b78f91c6967aa1d25ac05a3c45deb475a8aaaa58 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 19 Apr 2016 09:57:45 -0500 Subject: [PATCH] Match the usage of the shell kwarg --- setupbase.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setupbase.py b/setupbase.py index af6fabc82..b52e74998 100644 --- a/setupbase.py +++ b/setupbase.py @@ -336,13 +336,16 @@ def run(cmd, *args, **kwargs): def npm_install(cwd): """Run npm install in a directory and dedupe if necessary""" + try: run(['npm', 'install', '--progress=false'], cwd=cwd) except OSError as e: print("Failed to run `npm install`: %s" % e, file=sys.stderr) print("npm is required to build a development version of the notebook.", file=sys.stderr) raise - version = check_output('npm --version', shell=True).decode('utf-8') + + shell = (sys.platform == 'win32') + version = check_output('npm --version', shell=shell).decode('utf-8') if LooseVersion(version) < LooseVersion('3.0'): try: run(['npm', 'dedupe'], cwd=cwd)