From c07e96821872771c21c5b56876030ba4aad3e204 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 11 Apr 2025 12:30:22 +0200 Subject: [PATCH] Cleanup --- RNS/vendor/platformutils.py | 39 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/RNS/vendor/platformutils.py b/RNS/vendor/platformutils.py index b9d42e8..6bcbb5a 100644 --- a/RNS/vendor/platformutils.py +++ b/RNS/vendor/platformutils.py @@ -1,36 +1,26 @@ def get_platform(): from os import environ - if "ANDROID_ARGUMENT" in environ: - return "android" - elif "ANDROID_ROOT" in environ: - return "android" + if "ANDROID_ARGUMENT" in environ: return "android" + elif "ANDROID_ROOT" in environ: return "android" else: import sys return sys.platform def is_linux(): - if get_platform() == "linux": - return True - else: - return False + if get_platform() == "linux": return True + else: return False def is_darwin(): - if get_platform() == "darwin": - return True - else: - return False + if get_platform() == "darwin": return True + else: return False def is_android(): - if get_platform() == "android": - return True - else: - return False + if get_platform() == "android": return True + else: return False def is_windows(): - if str(get_platform()).startswith("win"): - return True - else: - return False + if str(get_platform()).startswith("win"): return True + else: return False def use_epoll(): if is_linux() or is_android(): return True @@ -43,8 +33,7 @@ def use_af_unix(): def platform_checks(): if is_windows(): import sys - if sys.version_info.major >= 3 and sys.version_info.minor >= 8: - pass + if sys.version_info.major >= 3 and sys.version_info.minor >= 8: pass else: import RNS RNS.log("On Windows, Reticulum requires Python 3.8 or higher.", RNS.LOG_ERROR) @@ -53,7 +42,5 @@ def platform_checks(): def cryptography_old_api(): import cryptography - if cryptography.__version__ == "2.8": - return True - else: - return False + if cryptography.__version__ == "2.8": return True + else: return False