Skip to content

Commit 5f10b0a

Browse files
committed
BF: When compiling code for JS the html/js templates didn't honour useVersion
As a result in 2021.2.0 - 2021.2.1 the JS experiments would fail to run if comiled with a different useVersion due to the change in import format in 2021.2 Problem arose in Commit 9cda6f5 because this led to psychopy.experiment being imported before the useVersion had been set
1 parent d47f466 commit 5f10b0a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

psychopy/scripts/psyexpCompile.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
from psychopy.constants import PY3
1717
from psychopy import __version__, logging
1818

19-
# parse args for subprocess
20-
from psychopy.experiment.routines import BaseStandaloneRoutine
19+
# DO NOT IMPORT ANY OTHER PSYCHOPY SUB-PACKAGES OR THEY WON'T SWITCH VERSIONS
2120

2221
parser = argparse.ArgumentParser(description='Compile your python file from here')
2322
parser.add_argument('infile', help='The input (psyexp) file to be compiled')
@@ -166,7 +165,7 @@ def _removeDisabledComponents(exp):
166165
# Leave original experiment unchanged.
167166
exp = deepcopy(exp)
168167
for key, routine in list(exp.routines.items()): # PY2/3 compat
169-
if isinstance(routine, BaseStandaloneRoutine):
168+
if routine.type == 'StandaloneRoutine':
170169
if routine.params['disabled']:
171170
for node in exp.flow:
172171
if node == routine:

0 commit comments

Comments
 (0)