You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if returning immediately is the best option as it's not a 'protected' function and a user should be allowed to pass in an empty list to 'clear' the event block. Not sure what the best option is however since the loop is a bit odd as it allows an iterator to be passed in which doesn't have len(). Removing the line and refactoring the loop might be a better solution:
write_count=0# Initiate counter in-case events is an empty iteratorfortime, labelinevents:
ifwrite_count==18:
# Don't raise Error, header events are rarely used.warnings.warn('Maximum of 18 events can be encoded in the header, skipping remaining events.')
breakevent_timings[write_count] =timeevent_labels[write_count] =labellabel_bytes[write_count*4:(write_count+1) *4] =label.encode('utf-8')
write_count+=1
Extending the doc-string might be good idea as well to just to inform the caller that it accepts an empty list.
When copying a c3d file with no events the variable
i
in this line is never defined, and the code crashes.py-c3d/c3d/c3d.py
Line 490 in 090544a
Is fixing this as easy as just returning an empty list, or is there more to it? If it's just returning an empty list, happy to open a PR for it.
The text was updated successfully, but these errors were encountered: