From 4302126b6cd714e8cdac9654c764568ace307cf5 Mon Sep 17 00:00:00 2001 From: surbhicis Date: Wed, 25 Aug 2021 15:32:49 +0530 Subject: [PATCH] kivy porting to python3 phase1 --- src/depends.py | 6 +++++- src/network/addrthread.py | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/depends.py b/src/depends.py index 85f66f0f..268137ec 100755 --- a/src/depends.py +++ b/src/depends.py @@ -303,7 +303,7 @@ def check_openssl(): ' OpenSSL 0.9.8b or later with AES, Elliptic Curves (EC),' ' ECDH, and ECDSA enabled.') return False - matches = cflags_regex.findall(openssl_cflags) + matches = cflags_regex.findall(openssl_cflags.decode('utf-8', "ignore")) if matches: logger.error( 'This OpenSSL library is missing the following required' @@ -424,6 +424,10 @@ def check_dependencies(verbose=False, optional=False): ' or greater is required. Python 2.7.18 is recommended.') sys.exit() + # FIXME: This needs to be uncommented when more of the code is python3 compatible + # if sys.hexversion >= 0x3000000 and sys.hexversion < 0x3060000: + # print("PyBitmessage requires python >= 3.6 if using python 3") + check_functions = [check_ripemd160, check_sqlite, check_openssl] if optional: check_functions.extend([check_msgpack, check_pyqt, check_curses]) diff --git a/src/network/addrthread.py b/src/network/addrthread.py index 3bf448d8..8b46750f 100644 --- a/src/network/addrthread.py +++ b/src/network/addrthread.py @@ -1,7 +1,8 @@ """ Announce addresses as they are received from other hosts """ -import Queue +from six.moves import queue + import state from helper_random import randomshuffle @@ -22,7 +23,7 @@ class AddrThread(StoppableThread): try: data = addrQueue.get(False) chunk.append(data) - except Queue.Empty: + except queue.Empty: break if chunk: