bchao1 / bullet

🚅 Interactive prompts made simple. Build a prompt like stacking blocks.
https://pypi.org/project/bullet/
MIT License
3.55k stars 113 forks source link

Input with strip=True will error when user presses the down arrow #85

Open lxylxy123456 opened 2 years ago

lxylxy123456 commented 2 years ago

I am working on MacOS. I have installed bullet 2.2.0 using pip. When I running the following code, and press the down arrow,

from bullet import Input
cli = Input('Press down arrow: ', strip=True)
result = cli.launch()

I see error:

% python3 /tmp/a.py
Press down arrow: Traceback (most recent call last):
  File "/tmp/a.py", line 3, in <module>
    result = cli.launch()
  File "/usr/local/lib/python3.9/site-packages/bullet/client.py", line 458, in launch
    return result.strip() if self.strip else result
AttributeError: 'NoneType' object has no attribute 'strip'
% 

This error does not happen when strip=False