Skip to content

Commit

Permalink
BF: When compiling code for JS the html/js templates didn't honour us…
Browse files Browse the repository at this point in the history
…eVersion

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
  • Loading branch information
peircej committed Aug 2, 2021
1 parent d47f466 commit 5f10b0a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions psychopy/scripts/psyexpCompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
from psychopy.constants import PY3
from psychopy import __version__, logging

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

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

0 comments on commit 5f10b0a

Please sign in to comment.