Skip to content

Commit 318c5ac

Browse files
committed
bah
1 parent 770d6fb commit 318c5ac

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎v3/js/pytutor.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,9 +1402,12 @@ ExecutionVisualizer.prototype.updateOutput = function(smoothTransition) {
14021402
// blocking prompt dialog!
14031403
var userInput = prompt(this.userInputPromptStr);
14041404

1405-
// after executing, jump back to this.curInstr to give the
1406-
// illusion of continuity
1407-
this.executeCodeWithRawInputFunc(userInput, this.curInstr);
1405+
// if you hit 'Cancel' in prompt(), it returns null
1406+
if (userInput !== null) {
1407+
// after executing, jump back to this.curInstr to give the
1408+
// illusion of continuity
1409+
this.executeCodeWithRawInputFunc(userInput, this.curInstr);
1410+
}
14081411
}
14091412
}
14101413
}

‎v3/web_exec.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ def cgi_finalizer(input_code, output_trace):
7272
else:
7373
form = cgi.FieldStorage()
7474
user_script = form['user_script'].value
75-
raw_input_json = form['raw_input_json'].value
75+
raw_input_json = ''
76+
if 'raw_input_json' in form:
77+
raw_input_json = form['raw_input_json'].value
7678
if 'cumulative_mode' in form:
7779
# convert from string to a Python boolean ...
7880
cumulative_mode = (form['cumulative_mode'].value == 'true')

0 commit comments

Comments
 (0)