summaryrefslogtreecommitdiff
path: root/prolog/problems/lists
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-02-17 15:44:40 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-02-17 15:44:40 +0100
commit66ae415ba019fa4528f61a23948e56a713902295 (patch)
tree3b626d214d3d85c6341f1fa2668a153e568fd66f /prolog/problems/lists
parent138610b0709d6e251c16b391242023eec393d775 (diff)
Prolog: only catch timeout in test functions
Diffstat (limited to 'prolog/problems/lists')
-rw-r--r--prolog/problems/lists/conc_3/common.py2
-rw-r--r--prolog/problems/lists/count_3/common.py2
-rw-r--r--prolog/problems/lists/del_3/common.py2
-rw-r--r--prolog/problems/lists/divide_3/common.py2
-rw-r--r--prolog/problems/lists/dup_2/common.py2
-rw-r--r--prolog/problems/lists/evenlen_1_+_oddlen_1/common.py2
-rw-r--r--prolog/problems/lists/insert_3/common.py2
-rw-r--r--prolog/problems/lists/len_2/common.py2
-rw-r--r--prolog/problems/lists/max_2/common.py2
-rw-r--r--prolog/problems/lists/memb_2/common.py2
-rw-r--r--prolog/problems/lists/min_2/common.py2
-rw-r--r--prolog/problems/lists/palindrome_1/common.py2
-rw-r--r--prolog/problems/lists/permute_2/common.py2
-rw-r--r--prolog/problems/lists/rev_2/common.py2
-rw-r--r--prolog/problems/lists/shiftleft_2/common.py2
-rw-r--r--prolog/problems/lists/shiftright_2/common.py2
-rw-r--r--prolog/problems/lists/sublist_2/common.py2
-rw-r--r--prolog/problems/lists/sum_2/common.py2
18 files changed, 18 insertions, 18 deletions
diff --git a/prolog/problems/lists/conc_3/common.py b/prolog/problems/lists/conc_3/common.py
index e24ec18..82b700f 100644
--- a/prolog/problems/lists/conc_3/common.py
+++ b/prolog/problems/lists/conc_3/common.py
@@ -36,7 +36,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/count_3/common.py b/prolog/problems/lists/count_3/common.py
index 25474b6..0f4f171 100644
--- a/prolog/problems/lists/count_3/common.py
+++ b/prolog/problems/lists/count_3/common.py
@@ -40,7 +40,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/del_3/common.py b/prolog/problems/lists/del_3/common.py
index 9a1554a..f19146f 100644
--- a/prolog/problems/lists/del_3/common.py
+++ b/prolog/problems/lists/del_3/common.py
@@ -34,7 +34,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/divide_3/common.py b/prolog/problems/lists/divide_3/common.py
index a600e02..25959aa 100644
--- a/prolog/problems/lists/divide_3/common.py
+++ b/prolog/problems/lists/divide_3/common.py
@@ -39,7 +39,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/dup_2/common.py b/prolog/problems/lists/dup_2/common.py
index 0593ae5..3697fa6 100644
--- a/prolog/problems/lists/dup_2/common.py
+++ b/prolog/problems/lists/dup_2/common.py
@@ -36,7 +36,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py b/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py
index 2adacaf..846ae95 100644
--- a/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py
+++ b/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py
@@ -42,7 +42,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/insert_3/common.py b/prolog/problems/lists/insert_3/common.py
index b3b5f1c..281d10c 100644
--- a/prolog/problems/lists/insert_3/common.py
+++ b/prolog/problems/lists/insert_3/common.py
@@ -36,7 +36,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/len_2/common.py b/prolog/problems/lists/len_2/common.py
index ca3d985..edcbe41 100644
--- a/prolog/problems/lists/len_2/common.py
+++ b/prolog/problems/lists/len_2/common.py
@@ -35,7 +35,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/max_2/common.py b/prolog/problems/lists/max_2/common.py
index b4a0311..5187df3 100644
--- a/prolog/problems/lists/max_2/common.py
+++ b/prolog/problems/lists/max_2/common.py
@@ -39,7 +39,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/memb_2/common.py b/prolog/problems/lists/memb_2/common.py
index e0914fa..b258731 100644
--- a/prolog/problems/lists/memb_2/common.py
+++ b/prolog/problems/lists/memb_2/common.py
@@ -32,7 +32,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/min_2/common.py b/prolog/problems/lists/min_2/common.py
index a26a14d..39ffe89 100644
--- a/prolog/problems/lists/min_2/common.py
+++ b/prolog/problems/lists/min_2/common.py
@@ -39,7 +39,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/palindrome_1/common.py b/prolog/problems/lists/palindrome_1/common.py
index 251c0da..df7b2c0 100644
--- a/prolog/problems/lists/palindrome_1/common.py
+++ b/prolog/problems/lists/palindrome_1/common.py
@@ -40,7 +40,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/permute_2/common.py b/prolog/problems/lists/permute_2/common.py
index 2568bbb..6a3cc7f 100644
--- a/prolog/problems/lists/permute_2/common.py
+++ b/prolog/problems/lists/permute_2/common.py
@@ -38,7 +38,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/rev_2/common.py b/prolog/problems/lists/rev_2/common.py
index 0875273..b34a2fa 100644
--- a/prolog/problems/lists/rev_2/common.py
+++ b/prolog/problems/lists/rev_2/common.py
@@ -38,7 +38,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/shiftleft_2/common.py b/prolog/problems/lists/shiftleft_2/common.py
index be0013f..0d1c224 100644
--- a/prolog/problems/lists/shiftleft_2/common.py
+++ b/prolog/problems/lists/shiftleft_2/common.py
@@ -36,7 +36,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/shiftright_2/common.py b/prolog/problems/lists/shiftright_2/common.py
index 21ce708..728bae9 100644
--- a/prolog/problems/lists/shiftright_2/common.py
+++ b/prolog/problems/lists/shiftright_2/common.py
@@ -36,7 +36,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/sublist_2/common.py b/prolog/problems/lists/sublist_2/common.py
index 99e0cf3..73e70ef 100644
--- a/prolog/problems/lists/sublist_2/common.py
+++ b/prolog/problems/lists/sublist_2/common.py
@@ -39,7 +39,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id:
diff --git a/prolog/problems/lists/sum_2/common.py b/prolog/problems/lists/sum_2/common.py
index 2b6808a..559b18f 100644
--- a/prolog/problems/lists/sum_2/common.py
+++ b/prolog/problems/lists/sum_2/common.py
@@ -35,7 +35,7 @@ def test(code, aux_code):
for query, answers in test_cases:
if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0):
n_correct += 1
- except:
+ except socket.timeout:
pass
finally:
if engine_id: