From f6a6d96a0780fd875ac649ca35a7889d3350a0a6 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 | 16 ++++++++++------ src/network/addrthread.py | 5 +++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/depends.py b/src/depends.py index 85f66f0f..b5cccbb1 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' @@ -418,11 +418,15 @@ def check_dependencies(verbose=False, optional=False): 'PyBitmessage requires Python 2.7.4 or greater' ' (but not Python 3+)') has_all_dependencies = False - if sys.hexversion >= 0x3000000: - logger.error( - 'PyBitmessage does not support Python 3+. Python 2.7.4' - ' or greater is required. Python 2.7.18 is recommended.') - sys.exit() + # if sys.hexversion >= 0x3000000: + # logger.error( + # 'PyBitmessage does not support Python 3+. Python 2.7.4' + # ' 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: 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: