diff --git a/tools/test.py b/tools/test.py index ebc755e0c484d6..f46b13fa30a66a 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1644,9 +1644,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