We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9769d3f + 4125dce commit 4e127abCopy full SHA for 4e127ab
intelhex/compat.py
@@ -57,7 +57,8 @@ def asstr(s):
57
return s
58
return s.decode('latin1')
59
60
- array_tobytes = getattr(array.array, "tobytes", array.array.tostring)
+ # for python >= 3.2 use 'tobytes', otherwise 'tostring'
61
+ array_tobytes = array.array.tobytes if sys.version_info[1] >= 2 else array.array.tostring
62
63
IntTypes = (int,)
64
StrType = str
0 commit comments