You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
738 B

  1. From 4125dce5b174401d38cc0fcf9d2e1aad07997f5e Mon Sep 17 00:00:00 2001
  2. From: fernandez85 <fernandez2005@gmail.com>
  3. Date: Sun, 11 Oct 2020 12:39:06 +0200
  4. Subject: [PATCH] Fix Python 3.9 compatibility issue with 'array' module
  5. ---
  6. intelhex/compat.py | 3 ++-
  7. 1 file changed, 2 insertions(+), 1 deletion(-)
  8. --- a/intelhex/compat.py
  9. +++ b/intelhex/compat.py
  10. @@ -57,7 +57,8 @@ if sys.version_info[0] >= 3:
  11. return s
  12. return s.decode('latin1')
  13. - array_tobytes = getattr(array.array, "tobytes", array.array.tostring)
  14. + # for python >= 3.2 use 'tobytes', otherwise 'tostring'
  15. + array_tobytes = array.array.tobytes if sys.version_info[1] >= 2 else array.array.tostring
  16. IntTypes = (int,)
  17. StrType = str