Skip to content

Commit

Permalink
BF: Leave out Variable components when tracking start/stop times
Browse files Browse the repository at this point in the history
This fixes an issue where Variable components cause AttributeErrors
when datatypes, that do not support attribute assigment, are used in the
component. The issue has arisen following new changes that the track start and
stop times of PsychoPy components. This fix stops Variable comps from being
added to the list of routine components that need start/stop times
recording. Fixes #2499.
  • Loading branch information
dvbridges authored and peircej committed Jul 3, 2019
1 parent a45cfb4 commit e1bca1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion psychopy/experiment/routine.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ def writeMainCode(self, buff):

code = '# keep track of which components have finished\n'
buff.writeIndentedLines(code)
# Get list of components, but leave out Variable components, which may not support attributes
compStr = ', '.join([c.params['name'].val for c in self
if 'startType' in c.params])
if 'startType' in c.params and c.type != 'Variable'])
buff.writeIndented('%sComponents = [%s]\n' % (self.name, compStr))
code = ("for thisComponent in %sComponents:\n"
" thisComponent.tStart = None\n"
Expand Down

0 comments on commit e1bca1b

Please sign in to comment.