summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/common.py2
-rw-r--r--python/problems/introduction/fahrenheit_to_celsius/common.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/python/common.py b/python/common.py
index 39c323f..5ce2eb3 100644
--- a/python/common.py
+++ b/python/common.py
@@ -9,7 +9,7 @@ hint_type = {
'syntax_error': Hint('syntax_error'),
}
-def hint(program):
+def hint(python, program):
# Check program for syntax errors.
try:
tree = ast.parse(program, filename='user')
diff --git a/python/problems/introduction/fahrenheit_to_celsius/common.py b/python/problems/introduction/fahrenheit_to_celsius/common.py
index 5c8e0cd..34f2832 100644
--- a/python/problems/introduction/fahrenheit_to_celsius/common.py
+++ b/python/problems/introduction/fahrenheit_to_celsius/common.py
@@ -19,7 +19,7 @@ hint_type = {
'no_input_call': Hint('no_input_call'),
}
-def test(session, code):
+def test(python, code):
# List of inputs: (expression to eval, stdin).
test_in = [
(None, '0\n'),
@@ -31,7 +31,7 @@ def test(session, code):
]
# List of outputs: (expression result, stdout, stderr, exception).
- answers = session.get_python().run(code=code, inputs=test_in, timeout=1.0)
+ answers = python(code=code, inputs=test_in, timeout=1.0)
outputs = [ans[1] for ans in answers]
n_correct = 0
@@ -40,7 +40,7 @@ def test(session, code):
n_correct += 1
return n_correct, len(test_in)
-def hint(session, code):
+def hint(python, code):
if not code:
return [{'id': 'plan'}]
if not has_token_sequence(code, ['input']):