diff options
-rwxr-xr-x | kpov_judge/add_task.py | 4 |
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) |