Skip to content

Commit 36a3553

Browse files
committed
Drop support for Python 2
1 parent a8e7ddf commit 36a3553

File tree

6 files changed

+12
-21
lines changed

6 files changed

+12
-21
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ jobs:
55
- python: pypy
66
include:
77
- python: pypy
8+
- python: 3.11
9+
- python: 3.10
10+
- python: 3.9
811
- python: 3.8
912
- python: 3.7
1013
- python: 3.6
1114
- python: 3.5
12-
- python: 2.7
1315
fast_finish: true
1416
before_install:
1517
- sudo apt-get update -qq

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ escaping of arguments and error checking:
2222
what's called a "command pool". The concurrency level can be customized and
2323
of course both local and remote commands are supported.
2424

25-
The package is currently tested on Python 2.7, 3.5, 3.6, 3.7, 3.8 and PyPy. For
26-
usage instructions please refer to following sections and the documentation_.
25+
The package is currently tested on Python 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11
26+
and PyPy. For usage instructions please refer to following sections and the
27+
documentation_.
2728

2829
.. contents::
2930
:local:

executor/contexts.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,7 @@ def lsb_release_variables(self):
366366
logger.debug("Parsing /etc/lsb-release contents: %r", contents)
367367
for lnum, line in enumerate(contents.splitlines()):
368368
name, delimiter, value = line.partition(u'=')
369-
# The following encode/decode trick works around shlex.split() not
370-
# properly supporting Unicode strings on Python 2.7, for details
371-
# refer to https://stackoverflow.com/a/14219159/788200.
372-
if PY2:
373-
tokens = shlex.split(value.encode('UTF-8'))
374-
parsed_value = [t.decode('UTF-8') for t in tokens]
375-
else:
376-
parsed_value = shlex.split(value)
369+
parsed_value = shlex.split(value)
377370
# The null byte check below guards against a weird edge case
378371
# that has so far only manifested in the Python 2.6 environment
379372
# of Travis CI: The parsing of /etc/lsb-release results in the

executor/tests.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,12 +1101,6 @@ def test_lsb_release_variables(self):
11011101
# laptop as well as Travis CI run Ubuntu LTS releases.
11021102
assert variables['DISTRIB_ID'].lower() == u'ubuntu'
11031103
assert variables['DISTRIB_CODENAME'].lower() in EXPECTED_CODENAMES
1104-
# Make sure all strings are Unicode strings, this tests against
1105-
# a regression of a bug caused by shlex.split() on Python 2.7
1106-
# automatically coercing Unicode strings to byte strings.
1107-
for key, value in context.lsb_release_variables.items():
1108-
assert isinstance(key, text_type)
1109-
assert isinstance(value, text_type)
11101104

11111105
def test_local_context(self):
11121106
"""Test a local command context."""

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def get_absolute_path(*args):
7676
tests_require=[
7777
'virtualenv',
7878
],
79-
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
79+
python_requires='>=3.5',
8080
classifiers=[
8181
'Development Status :: 5 - Production/Stable',
8282
'Environment :: Console',
@@ -88,13 +88,14 @@ def get_absolute_path(*args):
8888
'Operating System :: POSIX :: Linux',
8989
'Operating System :: Unix',
9090
'Programming Language :: Python',
91-
'Programming Language :: Python :: 2',
92-
'Programming Language :: Python :: 2.7',
9391
'Programming Language :: Python :: 3',
9492
'Programming Language :: Python :: 3.5',
9593
'Programming Language :: Python :: 3.6',
9694
'Programming Language :: Python :: 3.7',
9795
'Programming Language :: Python :: 3.8',
96+
'Programming Language :: Python :: 3.9',
97+
'Programming Language :: Python :: 3.10',
98+
'Programming Language :: Python :: 3.11',
9899
'Programming Language :: Python :: Implementation :: CPython',
99100
'Programming Language :: Python :: Implementation :: PyPy',
100101
'Topic :: Internet',

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27, py35, py36, py37, py38, pypy
2+
envlist = py35, py36, py37, py38, py39, py310, py311, pypy
33

44
[testenv]
55
commands = py.test {posargs}

0 commit comments

Comments
 (0)