diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-04-16 09:11:59 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-04-16 09:11:59 +0000 |
commit | 25de1d521ca218e2b040739fea77a39e9fc543e9 (patch) | |
tree | 21521d8866cf1462dbd52c071cf369974c29650e /contrib/python/pyasn1-modules/py3/pyasn1_modules/pem.py | |
parent | bf444b8ed4d0f6bf17fd753e2cf88f9440012e87 (diff) | |
parent | 0a63d9ddc516f206f2b8745ce5e5dfa60190d755 (diff) | |
download | ydb-25de1d521ca218e2b040739fea77a39e9fc543e9.tar.gz |
Merge branch 'rightlib' into mergelibs-240416-0910
Diffstat (limited to 'contrib/python/pyasn1-modules/py3/pyasn1_modules/pem.py')
-rw-r--r-- | contrib/python/pyasn1-modules/py3/pyasn1_modules/pem.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/contrib/python/pyasn1-modules/py3/pyasn1_modules/pem.py b/contrib/python/pyasn1-modules/py3/pyasn1_modules/pem.py index f7c80a9b9d..29235ab5cf 100644 --- a/contrib/python/pyasn1-modules/py3/pyasn1_modules/pem.py +++ b/contrib/python/pyasn1-modules/py3/pyasn1_modules/pem.py @@ -5,7 +5,6 @@ # License: http://snmplabs.com/pyasn1/license.html # import base64 -import sys stSpam, stHam, stDump = 0, 1, 2 @@ -38,10 +37,7 @@ def readPemBlocksFromFile(fileObj, *markers): else: certLines.append(certLine) if state == stDump: - if sys.version_info[0] <= 2: - substrate = ''.join([base64.b64decode(x) for x in certLines]) - else: - substrate = ''.encode().join([base64.b64decode(x.encode()) for x in certLines]) + substrate = ''.encode().join([base64.b64decode(x.encode()) for x in certLines]) break return idx, substrate @@ -55,10 +51,7 @@ def readPemFromFile(fileObj, def readBase64fromText(text): - if sys.version_info[0] <= 2: - return base64.b64decode(text) - else: - return base64.b64decode(text.encode()) + return base64.b64decode(text.encode()) def readBase64FromFile(fileObj): |