summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authoradityacp2020-03-19 19:36:13 +0530
committeradityacp2020-03-19 19:36:13 +0530
commit9933ec7861faf8abb38224e4b2f5f75fcf9e857a (patch)
tree4c7fd6eeaff48b5ddfb6148dabd63aa9edd6c215 /yaksh
parent369b65aa7a4b9efe5fe8053a1402067e8cedb6e1 (diff)
downloadonline_test-9933ec7861faf8abb38224e4b2f5f75fcf9e857a.tar.gz
online_test-9933ec7861faf8abb38224e4b2f5f75fcf9e857a.tar.bz2
online_test-9933ec7861faf8abb38224e4b2f5f75fcf9e857a.zip
Remove usage of module six
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/code_server.py2
-rw-r--r--yaksh/evaluator_tests/test_python_evaluation.py6
-rw-r--r--yaksh/language_registry.py3
-rw-r--r--yaksh/tests/test_code_server.py2
-rw-r--r--yaksh/views.py4
5 files changed, 6 insertions, 11 deletions
diff --git a/yaksh/code_server.py b/yaksh/code_server.py
index 75dd9b2..4feb7fd 100644
--- a/yaksh/code_server.py
+++ b/yaksh/code_server.py
@@ -25,7 +25,7 @@ import time
import requests
from tornado.ioloop import IOLoop
from tornado.web import Application, RequestHandler
-from six.moves import urllib
+import urllib
# Local imports
from .settings import N_CODE_SERVERS, SERVER_POOL_PORT
diff --git a/yaksh/evaluator_tests/test_python_evaluation.py b/yaksh/evaluator_tests/test_python_evaluation.py
index ad9b2c2..de973cf 100644
--- a/yaksh/evaluator_tests/test_python_evaluation.py
+++ b/yaksh/evaluator_tests/test_python_evaluation.py
@@ -523,7 +523,6 @@ class PythonStdIOEvaluationTestCases(EvaluatorBaseTest):
"weight": 0.0
}]
user_answer = dedent("""
- from six.moves import input
input_a = input()
input_b = input()
a = [int(i) for i in input_a.split(',')]
@@ -557,9 +556,8 @@ class PythonStdIOEvaluationTestCases(EvaluatorBaseTest):
"weight": 0.0
}]
user_answer = dedent("""
- from six.moves import input
- a = str(input())
- b = str(input())
+ a = input()
+ b = input()
print(a.count(b))
"""
)
diff --git a/yaksh/language_registry.py b/yaksh/language_registry.py
index ec5dae9..8059681 100644
--- a/yaksh/language_registry.py
+++ b/yaksh/language_registry.py
@@ -1,6 +1,5 @@
from __future__ import unicode_literals
import importlib
-import six
# Local imports
from .settings import code_evaluators
@@ -27,7 +26,7 @@ def create_evaluator_instance(metadata, test_case):
class _LanguageRegistry(object):
def __init__(self):
self._register = {}
- for language, module in six.iteritems(code_evaluators):
+ for language, module in code_evaluators.items():
self._register[language] = None
# Public Protocol ##########
diff --git a/yaksh/tests/test_code_server.py b/yaksh/tests/test_code_server.py
index 8237256..f4e73f0 100644
--- a/yaksh/tests/test_code_server.py
+++ b/yaksh/tests/test_code_server.py
@@ -6,7 +6,7 @@ except ImportError:
from queue import Queue
from threading import Thread
import unittest
-from six.moves import urllib
+import urllib
from yaksh.code_server import ServerPool, SERVER_POOL_PORT, submit, get_result
from yaksh import settings
diff --git a/yaksh/views.py b/yaksh/views.py
index b7b1524..a75763a 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -21,7 +21,6 @@ from django.contrib import messages
from taggit.models import Tag
from django.urls import reverse
import json
-import six
from textwrap import dedent
import zipfile
from markdown import Markdown
@@ -1738,8 +1737,7 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None,
if request.method == "POST":
papers = data['papers']
for paper in papers:
- for question, answers in six.iteritems(
- paper.get_question_answers()):
+ for question, answers in paper.get_question_answers().items():
marks = float(request.POST.get('q%d_marks' % question.id, 0))
answer = answers[-1]['answer']
answer.set_marks(marks)