JelmerT / cc2538-bsl

Python cross-platform script to upload firmware via the serial boot loader onto the CC13xx, CC2538 and CC26xx SoC.
BSD 3-Clause "New" or "Revised" License
515 stars 178 forks source link

Fails to execute on MacOS Catalina cc2538-bsl.py:971: SyntaxWarning: "is not" with a literal. Did you mean "!="? if int(value) % int(device.page_size) is not 0: #100

Closed wojciechczyz closed 3 years ago

wojciechczyz commented 3 years ago

python cc2538-bsl.py -h /Users/w/cc2538-bsl/cc2538-bsl.py:971: SyntaxWarning: "is not" with a literal. Did you mean "!="? if int(value) % int(device.page_size) is not 0: /Users/w/cc2538-bsl/cc2538-bsl.py:976: SyntaxWarning: "is not" with a literal. Did you mean "!="? if int(value, 16) % int(device.page_size) is not 0: Traceback (most recent call last): File "/Users/w/cc2538-bsl/cc2538-bsl.py", line 59, in from intelhex import IntelHex File "/Users/w/.pyenv/versions/3.9.0b5/lib/python3.9/site-packages/intelhex/init.py", line 44, in from intelhex.compat import ( File "/Users/w/.pyenv/versions/3.9.0b5/lib/python3.9/site-packages/intelhex/compat.py", line 60, in array_tobytes = getattr(array.array, "tobytes", array.array.tostring) AttributeError: type object 'array.array' has no attribute 'tostring'

JelmerT commented 3 years ago

This looks like an issue in the intelHex library, I can't reproduce it though.

Could you check your intelHex lib version with

$ pip3 show intelhex 

Name: intelhex
Version: 2.2.1
Summary: Python library for Intel HEX files manipulations
Home-page: https://pypi.python.org/pypi/IntelHex
Author: Alexander Belchenko
Author-email: alexander.belchenko@gmail.com
License: BSD
Location: /usr/local/lib/python3.8/site-packages
Requires:
Required-by: pyocd
JelmerT commented 3 years ago

the 2 SyntaxWarnings should be fixed with 733e6f5

wojciechczyz commented 3 years ago

Hi,

I have the same version you have got. Python is 3.9.05b. Strange that intelHex library is triggereed when I am just doing -h , can we avoid it?

Cheers, Wojciech

On 7 Oct 2020, at 23:49, Jelmer Tiete notifications@github.com wrote:

 This looks like an issue in the intelHex library, I can't reproduce it though.

Could you check your intelHex lib version with

$ pip3 show intelhex

Name: intelhex Version: 2.2.1 Summary: Python library for Intel HEX files manipulations Home-page: https://pypi.python.org/pypi/IntelHex Author: Alexander Belchenko Author-email: alexander.belchenko@gmail.com License: BSD Location: /usr/local/lib/python3.8/site-packages Requires: Required-by: pyocd — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

wojciechczyz commented 3 years ago

Thank you for the correction, now I am getting only this: python cc2538-bsl.py -h

Traceback (most recent call last): File "/Users/w/cc2538-bsl/cc2538-bsl.py", line 59, in from intelhex import IntelHex File "/Users/w/.pyenv/versions/3.9.0b5/lib/python3.9/site-packages/intelhex/init.py", line 44, in from intelhex.compat import ( File "/Users/w/.pyenv/versions/3.9.0b5/lib/python3.9/site-packages/intelhex/compat.py", line 60, in array_tobytes = getattr(array.array, "tobytes", array.array.tostring) AttributeError: type object 'array.array' has no attribute 'tostring'

wojciechczyz commented 3 years ago

Remaining problem is already reported in intelhex https://github.com/python-intelhex/intelhex/issues/45