summaryrefslogtreecommitdiff
path: root/kpov_judge
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-10-13 03:30:35 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-10-13 03:30:35 +0200
commit4abbcde4b21be7d3c07a2d483c23a951ff57cb12 (patch)
tree1b4d291d69104ed5fe12a4e68a4659862861c8b0 /kpov_judge
parentb41b2bebc05585a6e374dafafae9bed2503becad (diff)
Fix urllib for Python 3
Diffstat (limited to 'kpov_judge')
-rwxr-xr-xkpov_judge/add_task.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/kpov_judge/add_task.py b/kpov_judge/add_task.py
index 92e0c37..ea11c9c 100755
--- a/kpov_judge/add_task.py
+++ b/kpov_judge/add_task.py
@@ -15,10 +15,10 @@ def task_check(results, params):
data = urllib.parse.urlencode({
'results': json.dumps(results),
'params': json.dumps(params)
- })
+ }).encode()
req = urllib.request.Request('{task_url}/{task_name}/results.json'.format(task_url=task_url, task_name=task_name), data)
response = urllib.request.urlopen(req)
- response_dict = json.loads(response.read())
+ response_dict = json.loads(response.read().decode())
hints = response_dict.get('hints', [])
hints = ['status: ' + response_dict.get('status', '')] + hints
return response_dict.get('result', 'No result'), "\n".join(hints)