ソースを参照

Fix preflight complex extend handling (#21191)

Alexander D. Kanevskiy 4年前
コミット
24623d398c
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更11行の追加8行の削除
  1. 11
    8
      buildroot/share/PlatformIO/scripts/preflight-checks.py

+ 11
- 8
buildroot/share/PlatformIO/scripts/preflight-checks.py ファイルの表示

1
 #
1
 #
2
 # preflight-checks.py
2
 # preflight-checks.py
3
-# Script to check for common issues prior to compiling
3
+# Check for common issues prior to compiling
4
 #
4
 #
5
 import os
5
 import os
6
 import re
6
 import re
25
         return True
25
         return True
26
     ext = config.get(build_env, 'extends', default=None)
26
     ext = config.get(build_env, 'extends', default=None)
27
     if ext:
27
     if ext:
28
-        for ext_env in ext:
29
-            if check_envs(ext_env, base_envs, config):
30
-                return True
28
+        if isinstance(ext, str):
29
+            return check_envs(ext, base_envs, config)
30
+        elif isinstance(ext, list):
31
+            for ext_env in ext:
32
+                if check_envs(ext_env, base_envs, config):
33
+                    return True
31
     return False
34
     return False
32
 
35
 
33
 # Sanity checks:
36
 # Sanity checks:
56
 # Check for Config files in two common incorrect places
59
 # Check for Config files in two common incorrect places
57
 #
60
 #
58
 for p in [ env['PROJECT_DIR'], os.path.join(env['PROJECT_DIR'], "config") ]:
61
 for p in [ env['PROJECT_DIR'], os.path.join(env['PROJECT_DIR'], "config") ]:
59
-	for f in [ "Configuration.h", "Configuration_adv.h" ]:
60
-		if os.path.isfile(os.path.join(p, f)):
61
-			err = "ERROR: Config files found in directory %s. Please move them into the Marlin subfolder." % p
62
-			raise SystemExit(err)
62
+    for f in [ "Configuration.h", "Configuration_adv.h" ]:
63
+        if os.path.isfile(os.path.join(p, f)):
64
+            err = "ERROR: Config files found in directory %s. Please move them into the Marlin subfolder." % p
65
+            raise SystemExit(err)

読み込み中…
キャンセル
保存