From 23fc38f7c906c8b3b2f37c8667d48c86ec03a267 Mon Sep 17 00:00:00 2001 From: Ali Alaee Date: Sat, 28 Nov 2020 18:24:52 +0330 Subject: [PATCH] Fix crypto imports on macOS Big Sur (#1639) --- telethon/crypto/libssl.py | 4 ++-- telethon/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/telethon/crypto/libssl.py b/telethon/crypto/libssl.py index a11fdbc6..e0fea00e 100644 --- a/telethon/crypto/libssl.py +++ b/telethon/crypto/libssl.py @@ -23,11 +23,11 @@ def _find_ssl_lib(): # https://www.shh.sh/2020/01/04/python-abort-trap-6.html if sys.platform == 'darwin': release, _version_info, _machine = platform.mac_ver() - ten, major, *minor = release.split('.') + ver, major, *_ = release.split('.') # macOS 10.14 "mojave" is the last known major release # to support unversioned libssl.dylib. Anything above # needs specific versions - if major and int(major) > 14: + if int(ver) > 10 or int(ver) == 10 and int(major) > 14: lib = ( ctypes.util.find_library('libssl.46') or ctypes.util.find_library('libssl.44') or diff --git a/telethon/version.py b/telethon/version.py index 620803c8..76bdba70 100644 --- a/telethon/version.py +++ b/telethon/version.py @@ -1,3 +1,3 @@ # Versions should comply with PEP440. # This line is parsed in setup.py: -__version__ = '1.18.0' +__version__ = '1.18.1'