0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

test: fix temp-dir option in tools/test.py

If a temp-dir is specified and already exists, the NODE_TEST_DIR
environment variable will never be set. This fixes that.

PR-URL: https://github.com/nodejs/node/pull/10723
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
Gibson Fahnestock 2017-01-10 15:36:07 +00:00 committed by James M Snell
parent dd2d3d3f9d
commit 57f6a106fb

View File

@ -1628,9 +1628,9 @@ def Main():
tempdir = os.environ.get('NODE_TEST_DIR') or options.temp_dir
if tempdir:
os.environ['NODE_TEST_DIR'] = tempdir
try:
os.makedirs(tempdir)
os.environ['NODE_TEST_DIR'] = tempdir
except OSError as exception:
if exception.errno != errno.EEXIST:
print "Could not create the temporary directory", options.temp_dir