# Error feedback has syntax error

**URL:** <https://discourse.psychopy.org/t/error-feedback-has-syntax-error/1509>\
**Category:** Builder\
**Created:** [November 22, 2016, 3:48am UTC](https://discourse.psychopy.org/t/error-feedback-has-syntax-error/1509 "2016-11-22T03:48:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KyleMorrissey](https://avatars.discourse-cdn.com/v4/letter/k/b38774/32.png) [@KyleMorrissey](https://discourse.psychopy.org/u/KyleMorrissey)\
**Post date:** [November 22, 2016, 3:48am UTC](https://discourse.psychopy.org/t/error-feedback-has-syntax-error/1509/1 "2016-11-22T03:48:55Z")

</div>

Hey so just a heads up, the psychopy error feedback code component, detailed here:  
[http://www.psychopy.org/recipes/builderFeedback.html](http://www.psychopy.org/recipes/builderFeedback.html)  
… has some sort of syntax error.

It works fine if you type for an incorrect or a correct response, but if a user doesn’t give a response, the experiment crashes and there is no “no response detected” feedback. The error message is:

```auto
if len(key_resp.keys) <1:
TypeError: Object of type 'NoneType' has no len()

```

Now I know just enough about python to just remove the “no response given” option so that non-reponses elicit the same feedback as errors, which stops the crashing problem, however seeing as this is offered on the website, someone should probably fix it. I don’t imagine it is a difficult fix for someone who knows something about programming.

Cheers.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/richard/32/6389_2.png) [@richard](https://discourse.psychopy.org/u/richard)\
**Post date:** [November 22, 2016, 8:25am UTC](https://discourse.psychopy.org/t/error-feedback-has-syntax-error/1509/2 "2016-11-22T08:25:28Z")

</div>

> [@KyleMorrissey](#):
>
> ```auto
> if len(key_resp.keys) <1:
> TypeError: Object of type 'NoneType' has no len()
> 
> ```

Should probably be changed to

```auto
if not key_resp.keys:

```

If that fixes the problem, you are very welcome to edit [the corresponding documentation source file](https://github.com/psychopy/psychopy/blob/master/docs/source/recipes/builderFeedback.rst) on GitHub and file a pull request!

---

<div class="post-metadata">

**Author:** ![KyleMorrissey](https://avatars.discourse-cdn.com/v4/letter/k/b38774/32.png) [@KyleMorrissey](https://discourse.psychopy.org/u/KyleMorrissey)\
**Post date:** [November 22, 2016, 12:15pm UTC](https://discourse.psychopy.org/t/error-feedback-has-syntax-error/1509/3 "2016-11-22T12:15:00Z")

</div>

Hi Richard,  
Yup that fixes the error message!  
I don’t really know how Github works though, so I am about 70% sure that I registered the correction correctly.

Thanks,  
Kyle

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/richard/32/6389_2.png) [@richard](https://discourse.psychopy.org/u/richard)\
**Post date:** [November 22, 2016, 12:29pm UTC](https://discourse.psychopy.org/t/error-feedback-has-syntax-error/1509/4 "2016-11-22T12:29:41Z")

</div>

Looks good to me!  
xref:

> <https://github.com/psychopy/psychopy/pull/1311>
