maya-ur commited on
Commit
d3b74e1
·
verified ·
1 Parent(s): add507e

Update solver.py

Browse files
Files changed (1) hide show
  1. solver.py +16 -14
solver.py CHANGED
@@ -474,20 +474,22 @@ class QuizSolver:
474
 
475
  if dependencies!=[]:
476
 
477
-
478
- to_install=[sys.executable, "-m", "pip", "install"] + dependencies
479
-
480
- print('Starting package installation',flush=True)
481
-
482
- result = subprocess.run(
483
- to_install,
484
- check=True,
485
- text=True,
486
- capture_output=True
487
- )
488
-
489
- if result.returncode!=0:
490
- return 'Error in installing packages'
 
 
491
 
492
  file_path = os.path.join(self.temp_dir.name, "script.py")
493
 
 
474
 
475
  if dependencies!=[]:
476
 
477
+ try:
478
+ to_install=[sys.executable, "-m", "pip", "install"] + dependencies
479
+
480
+ print('Starting package installation',flush=True)
481
+
482
+ result = subprocess.run(
483
+ to_install,
484
+ check=True,
485
+ text=True,
486
+ capture_output=True
487
+ )
488
+
489
+ if result.returncode!=0:
490
+ return 100
491
+ except:
492
+ return 100
493
 
494
  file_path = os.path.join(self.temp_dir.name, "script.py")
495