Pārlūkot izejas kodu

🔧 Schema catch missing pip

Scott Lahteine 2 gadus atpakaļ
vecāks
revīzija
9c86ca3a19
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6
    2
      buildroot/share/PlatformIO/scripts/schema.py

+ 6
- 2
buildroot/share/PlatformIO/scripts/schema.py Parādīt failu

@@ -393,8 +393,12 @@ def main():
393 393
 		except ImportError:
394 394
 			print("Installing YAML module ...")
395 395
 			import subprocess
396
-			subprocess.run(['python3', '-m', 'pip', 'install', 'pyyaml'])
397
-			import yaml
396
+			try:
397
+				subprocess.run(['python3', '-m', 'pip', 'install', 'pyyaml'])
398
+				import yaml
399
+			except:
400
+				print("Failed to install YAML module")
401
+				return
398 402
 
399 403
 		print("Generating YML ...")
400 404
 		dump_yaml(schema, Path('schema.yml'))

Notiek ielāde…
Atcelt
Saglabāt