Skip to content

Commit 9ec5409

Browse files
authored
Drop support for EOL Python 2.7 (#12)
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 252ac00 commit 9ec5409

File tree

4 files changed

+5
-21
lines changed

4 files changed

+5
-21
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,17 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
python-version:
36-
- "2.7"
3736
- "3.6"
3837
- "3.7"
3938
- "3.8"
4039
- "3.9"
4140
- "3.10"
4241
- "3.11"
43-
- "pypy-2.7"
4442
- "pypy-3.7"
4543
- "pypy-3.8"
4644
- "pypy-3.9"
4745
# 20.04 because https://github.com/actions/python-versions
48-
# does not have 2.7 and 3.6 binaries for 22.04.
46+
# does not have 3.6 binaries for 22.04.
4947
os: ["ubuntu-20.04"]
5048
include:
5149
- { python-version: "3.12", os: "ubuntu-latest" }

pyasn1_modules/pem.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# License: http://snmplabs.com/pyasn1/license.html
66
#
77
import base64
8-
import sys
98

109
stSpam, stHam, stDump = 0, 1, 2
1110

@@ -38,10 +37,7 @@ def readPemBlocksFromFile(fileObj, *markers):
3837
else:
3938
certLines.append(certLine)
4039
if state == stDump:
41-
if sys.version_info[0] <= 2:
42-
substrate = ''.join([base64.b64decode(x) for x in certLines])
43-
else:
44-
substrate = ''.encode().join([base64.b64decode(x.encode()) for x in certLines])
40+
substrate = ''.encode().join([base64.b64decode(x.encode()) for x in certLines])
4541
break
4642
return idx, substrate
4743

@@ -55,10 +51,7 @@ def readPemFromFile(fileObj,
5551

5652

5753
def readBase64fromText(text):
58-
if sys.version_info[0] <= 2:
59-
return base64.b64decode(text)
60-
else:
61-
return base64.b64decode(text.encode())
54+
return base64.b64decode(text.encode())
6255

6356

6457
def readBase64FromFile(fileObj):

setup.cfg

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ classifiers =
2727
License :: OSI Approved :: BSD License
2828
Natural Language :: English
2929
Operating System :: OS Independent
30-
Programming Language :: Python :: 2
31-
Programming Language :: Python :: 2.7
3230
Programming Language :: Python :: 3
3331
Programming Language :: Python :: 3.6
3432
Programming Language :: Python :: 3.7
@@ -43,13 +41,10 @@ classifiers =
4341
Topic :: Software Development :: Libraries :: Python Modules
4442

4543
[options]
46-
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*
44+
python_requires = >=3.6
4745
zip_safe = True
4846
setup_requires = setuptools
4947
install_requires =
5048
pyasn1>=0.4.6,<0.6.0
5149
packages =
5250
pyasn1_modules
53-
54-
[bdist_wheel]
55-
universal = 1

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
minversion = 3.5.0
33
envlist =
4-
py27, py36, py37, py38, py39, py310, py311, py312, pypy27, pypy37, pypy38, pypy39
4+
py{36, 37, 38, 39, 310, 311, 312, py37, py38, py39}
55
cover, bandit, build
66
isolated_build = true
77
skip_missing_interpreters = true
@@ -39,15 +39,13 @@ commands =
3939

4040
[gh-actions]
4141
python =
42-
2.7: py27
4342
3.6: py36
4443
3.7: py37
4544
3.8: py38
4645
3.9: py39
4746
3.10: py310, cover, build, bandit
4847
3.11: py311
4948
3.12: py312
50-
pypy-2.7: pypy27
5149
pypy-3.7: pypy37
5250
pypy-3.8: pypy38
5351
pypy-3.9: pypy39

0 commit comments

Comments
 (0)