Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit c8c831d

Browse files
committed
bug fix: handle the python3 option correctly.
1 parent f3ad271 commit c8c831d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

runestone/activecode/js/activecode.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ActiveCode.prototype.init = function(opts) {
2121
var suffStart = -1;
2222
var orig = opts.orig
2323
this.useRunestoneServices = opts.useRunestoneServices;
24+
this.python3 = opts.python3;
2425
this.origElem = orig;
2526
this.divid = orig.id;
2627
this.code = $(orig).text();
@@ -603,7 +604,7 @@ ActiveCode.prototype.runProg = function() {
603604
$(this.eContainer).remove();
604605
Sk.configure({output : this.outputfun.bind(this),
605606
read : this.builtinRead,
606-
python3: true,
607+
python3: this.python3,
607608
imageProxy : 'http://image.runestone.academy:8080/320x'
608609
});
609610
Sk.divid = this.divid;
@@ -1418,7 +1419,7 @@ LiveCode.prototype.pushDataFile = function (datadiv) {
14181419

14191420
$(document).ready(function() {
14201421
$('[data-component=activecode]').each( function(index ) {
1421-
var opts = {'orig' : this, 'useRunestoneServices': eBookConfig.useRunestoneServices }
1422+
var opts = {'orig' : this, 'useRunestoneServices': eBookConfig.useRunestoneServices, 'python3' : eBookConfig.python3 }
14221423
if ($(this).data('lang') === "javascript") {
14231424
edList[this.id] = new JSActiveCode(opts);
14241425
} else if ($(this).data('lang') === 'htmlmixed') {

0 commit comments

Comments
 (0)