From: Eli Bendersky Date: Mon, 15 Aug 2022 13:15:29 +0000 (-0700) Subject: Officially remove Python 2 support from this point forward X-Git-Tag: v0.30~34 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=71cdec9a1fe138252005f2821e18dc4365941091;p=pyelftools.git Officially remove Python 2 support from this point forward This change removes the support from setup.py and the testing files, and adds an assertion to py3compat that will crash when pyelftools is run w/ Python 2 Doesn't remove compatibility code, yet Updates #415 --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2009bf8..787dc9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [2.7, 3.7, 3.9] + python-version: [3.7, 3.9, 3.10] os: [ubuntu-latest] steps: diff --git a/elftools/common/py3compat.py b/elftools/common/py3compat.py index 46bbfb3..336164e 100644 --- a/elftools/common/py3compat.py +++ b/elftools/common/py3compat.py @@ -8,6 +8,10 @@ #------------------------------------------------------------------------------- import sys PY3 = sys.version_info[0] == 3 +assert PY3, '''\ +Python 2 is no longer supported by pyelftools; if you need to use Python 2, +please download an older pyelftools version (such as version 0.29). +''' if PY3: diff --git a/setup.py b/setup.py index c7faa07..023cf05 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,6 @@ setup( url='https://github.com/eliben/pyelftools', platforms='Cross Platform', classifiers = [ - 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', ], diff --git a/tox.ini b/tox.ini index d132537..8fbbb29 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py38 +envlist = py38 [testenv] setenv =