eblot / pyspiflash

SPI data flash device drivers (pure Python)
MIT License
39 stars 30 forks source link

Fix copy-paste typo in get_capacity() #30

Open kuba2k2 opened 9 months ago

kuba2k2 commented 9 months ago

SerialFlash.get_capacity() calls raise instead of return, which causes the following error:

E: TypeError: exceptions must derive from BaseException
E: |-- File "C:\Dev\Python310\lib\site-packages\spiflash\serialflash.py", line 153, in get_capacity

I was trying to use get_capacity() instead of len(flash) because the latter is not recognized by IntelliJ (missing __len__ in the base SerialFlash class).