Skip to content

Commit 696e634

Browse files
committed
hopefully fixes esp32 build
1 parent f246774 commit 696e634

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

builder/esp32.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,13 @@ def setup_idf_environ():
300300

301301
py_path = os.path.split(sys.executable)[0]
302302

303-
if 'PATH' in os.environ:
304-
os.environ['PATH'] = py_path + os.pathsep + os.environ['PATH']
305-
elif 'path' in os.environ:
306-
os.environ['path'] = py_path + os.pathsep + os.environ['path']
303+
if 'PATH' in env:
304+
env['PATH'] = py_path + os.pathsep + env['PATH']
305+
elif 'path' in env:
306+
env['PATH'] = py_path + os.pathsep + env['path']
307+
del env['path']
307308
else:
308-
os.environ['PATH'] = py_path + os.pathsep
309+
env['PATH'] = py_path + os.pathsep
309310

310311
result, output = spawn(cmds, env=env, out_to_screen=False)
311312

@@ -320,21 +321,11 @@ def setup_idf_environ():
320321
for line in output
321322
}
322323

323-
print(temp_env)
324-
325324
if 'PATH' in temp_env:
326325
env['PATH'] = temp_env['PATH']
327326
elif 'path' in temp_env:
328327
env['PATH'] = temp_env['path']
329328

330-
if 'IDF_PATH' in temp_env:
331-
env['IDF_PATH'] = temp_env['IDF_PATH']
332-
elif 'idf_path' in temp_env:
333-
env['IDF_PATH'] = temp_env['idf_path']
334-
else:
335-
print(output)
336-
raise RuntimeError(f'"IDF_PATH" not found in environment.')
337-
338329
else:
339330
args = sys.argv[:]
340331

0 commit comments

Comments
 (0)