From 37c69031da5a0e14d65ceaf97d0f2ee2e322ccc6 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Mon, 7 Nov 2022 15:14:20 +0100 Subject: [PATCH] moved randbytes to np.random.bytes for python3.7 compatibility --- tnc/data_handler.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tnc/data_handler.py b/tnc/data_handler.py index 6a187719..4474ca8d 100644 --- a/tnc/data_handler.py +++ b/tnc/data_handler.py @@ -13,7 +13,7 @@ import threading import time import uuid import zlib -from random import randrange, randbytes +from random import randrange# , randbytes import codec2 import helpers @@ -361,7 +361,7 @@ class DATA: def enqueue_frame_for_tx( self, - frame_to_tx: list[bytearray], + frame_to_tx,# : list[bytearray], # this causes a crash on python 3.7 c2_mode=FREEDV_MODE.datac0.value, copies=1, repeat_delay=0, @@ -1323,7 +1323,8 @@ class DATA: static.ARQ_SESSION_STATE = "connecting" # create a random session id - self.session_id = randbytes(1) + # self.session_id = randbytes(1) + self.session_id = np.random.bytes(1) print(self.session_id) connection_frame = bytearray(self.length_sig0_frame) @@ -1615,7 +1616,8 @@ class DATA: # init a new random session id if we are not in an arq session if not static.ARQ_SESSION: - self.session_id = randbytes(1) + # self.session_id = randbytes(1) + self.session_id = np.random.bytes(1) print(self.session_id) # Update data_channel timestamp