Skip to content

Commit d3c5f66

Browse files
authored
Merge pull request #102 from pgorny/python-39-support
[fixes #101] Update EasyAVR for Python 3.9 support
2 parents 52403c5 + 8761854 commit d3c5f66

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

keymapper/easykeymap/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from .templates import matrix_dims, macro_lengths, max_leds
2929
from .version import version_string
3030
import easykeymap.intelhex as intelhex
31+
import sys as sys
3132

3233

3334
NUM_LAYERS = 10
@@ -257,7 +258,8 @@ def overlay_macros(user_data, hex_data, external_data):
257258
offset = config.firmware.macro_map - start
258259
for index in index_list:
259260
short_array = array('H', [index])
260-
byte_array[offset:offset+2] = array('B', short_array.tostring())
261+
array_bytes = short_array.tobytes() if sys.version_info >= (3, 2) else short_array.tostring()
262+
byte_array[offset:offset+2] = array('B', array_bytes)
261263
offset += 2
262264
# map the non-empty macros into the byte array
263265
for i in range(NUM_MACROS):

keymapper/easykeymap/gui/programdialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def OnButton(self, event):
129129
self.timer.Start(250)
130130

131131
def OnTimer(self, event):
132-
if not (self.runthread and self.runthread.isAlive()):
132+
if not (self.runthread and self.runthread.is_alive()):
133133
self.log_text('\n\n')
134134
self.task_ch.Enable(True)
135135
self.run_btn.Enable(True)

0 commit comments

Comments
 (0)