Преглед изворни кода

Fix preflight complex extend handling (#21191)

Alexander D. Kanevskiy пре 4 година
родитељ
комит
24623d398c
No account linked to committer's email address
1 измењених фајлова са 11 додато и 8 уклоњено
  1. 11
    8
      buildroot/share/PlatformIO/scripts/preflight-checks.py

+ 11
- 8
buildroot/share/PlatformIO/scripts/preflight-checks.py Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 #
2 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 5
 import os
6 6
 import re
@@ -25,9 +25,12 @@ def check_envs(build_env, base_envs, config):
25 25
         return True
26 26
     ext = config.get(build_env, 'extends', default=None)
27 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 34
     return False
32 35
 
33 36
 # Sanity checks:
@@ -56,7 +59,7 @@ if not result:
56 59
 # Check for Config files in two common incorrect places
57 60
 #
58 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)

Loading…
Откажи
Сачувај