Skip to content

Commit e1bca1b

Browse files
dvbridgespeircej
authored andcommitted
BF: Leave out Variable components when tracking start/stop times
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.
1 parent a45cfb4 commit e1bca1b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

psychopy/experiment/routine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,9 @@ def writeMainCode(self, buff):
134134

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

0 commit comments

Comments
 (0)