Просмотр исходного кода

Merge branch 'bugfix/no_pyc_files_v4.1' into 'release/v4.1'

tools: Don't generate pyc files (v4.1)

See merge request espressif/esp-idf!8970
Angus Gratton 5 лет назад
Родитель
Сommit
b76c3afa3a
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      tools/idf.py

+ 6 - 2
tools/idf.py

@@ -37,8 +37,12 @@ from collections import Counter, OrderedDict
 from importlib import import_module
 from pkgutil import iter_modules
 
-from idf_py_actions.errors import FatalError
-from idf_py_actions.tools import (executable_exists, idf_version, merge_action_lists, realpath)
+# pyc files remain in the filesystem when switching between branches which might raise errors for incompatible
+# idf.py extentions. Therefore, pyc file generation is turned off:
+sys.dont_write_bytecode = True
+
+from idf_py_actions.errors import FatalError  # noqa: E402
+from idf_py_actions.tools import (executable_exists, idf_version, merge_action_lists, realpath)  # noqa: E402
 
 # Use this Python interpreter for any subprocesses we launch
 PYTHON = sys.executable