add try/except block around subprocess
This commit is contained in:
parent
1172405994
commit
0e6067ffe3
2 changed files with 28 additions and 23 deletions
|
@ -1,6 +1,6 @@
|
||||||
import json
|
import json
|
||||||
from site_api import get, api, replay
|
from site_api import get, api, replay
|
||||||
from sat import COLORS, solve_sat
|
from sat import solve_sat
|
||||||
from database import Game, store, load, commit, conn
|
from database import Game, store, load, commit, conn
|
||||||
from download_data import export_game
|
from download_data import export_game
|
||||||
from variants import num_suits, VARIANTS, variant_name
|
from variants import num_suits, VARIANTS, variant_name
|
||||||
|
@ -144,6 +144,7 @@ def solve_instance(num_players, deck):
|
||||||
|
|
||||||
|
|
||||||
def solve_seed(seed, num_players, deck_compressed, var_id):
|
def solve_seed(seed, num_players, deck_compressed, var_id):
|
||||||
|
try:
|
||||||
deck = decompress_deck(deck_compressed)
|
deck = decompress_deck(deck_compressed)
|
||||||
t0 = perf_counter()
|
t0 = perf_counter()
|
||||||
solvable, solution, num_remaining_cards = solve_instance(num_players, deck)
|
solvable, solution, num_remaining_cards = solve_instance(num_players, deck)
|
||||||
|
@ -169,6 +170,9 @@ def solve_seed(seed, num_players, deck_compressed, var_id):
|
||||||
raise Exception("Programming Error")
|
raise Exception("Programming Error")
|
||||||
|
|
||||||
mutex.release()
|
mutex.release()
|
||||||
|
except Exception:
|
||||||
|
traceback.format_exc()
|
||||||
|
print("exception in subprocess:")
|
||||||
|
|
||||||
|
|
||||||
def solve_unknown_seeds():
|
def solve_unknown_seeds():
|
||||||
|
|
|
@ -4,3 +4,4 @@ pysmt
|
||||||
termcolor
|
termcolor
|
||||||
more_itertools
|
more_itertools
|
||||||
psycopg2
|
psycopg2
|
||||||
|
alive_progress
|
||||||
|
|
Loading…
Reference in a new issue