Browse Source

🔧 Schema catch missing pip

Scott Lahteine 1 year ago
parent
commit
9c86ca3a19
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      buildroot/share/PlatformIO/scripts/schema.py

+ 6
- 2
buildroot/share/PlatformIO/scripts/schema.py View File

@@ -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'))

Loading…
Cancel
Save