From 6056130138d5e9d54bccf51fd71ee8548a43fa5e Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 25 Dec 2021 21:01:58 +0100 Subject: [PATCH] Drop Python 2.6 support Signed-off-by: mayeut --- Makefile | 2 +- README.rst | 2 +- docs/index.rst | 4 ++-- make.bat | 2 +- psutil/_common.py | 5 +---- psutil/tests/test_process.py | 2 +- psutil/tests/test_windows.py | 2 -- scripts/internal/print_announce.py | 2 +- setup.py | 3 +-- 9 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 0ab1ea06ea..06ed72307b 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ DEPS = \ PY2_DEPS = \ futures \ ipaddress \ - mock==1.0.1 \ + mock \ unittest2 DEPS += `$(PYTHON) -c \ "import sys; print('$(PY2_DEPS)' if sys.version_info[0] == 2 else '')"` diff --git a/README.rst b/README.rst index 6ad07db238..fd9fbc1cde 100644 --- a/README.rst +++ b/README.rst @@ -98,7 +98,7 @@ psutil currently supports the following platforms: - **Sun Solaris** - **AIX** -Supported Python versions are **2.6**, **2.7**, **3.4+** and +Supported Python versions are **2.7**, **3.4+** and `PyPy `__. Funding diff --git a/docs/index.rst b/docs/index.rst index 2ac9c2ce3b..7804b81559 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -38,7 +38,7 @@ psutil currently supports the following platforms: - **Sun Solaris** - **AIX** -Supported Python versions are **2.6**, **2.7** and **3.4+**. +Supported Python versions are **2.7** and **3.4+**. `PyPy `__ is also known to work. The psutil documentation you're reading is distributed as a single HTML page. @@ -2605,7 +2605,7 @@ Platforms support history * psutil 0.1.1 (2009-03): **FreeBSD** * psutil 0.1.0 (2009-01): **Linux, Windows, macOS** -Supported Python versions are 2.6, 2.7, 3.4+ and PyPy3. +Supported Python versions are 2.7, 3.4+ and PyPy3. Timeline ======== diff --git a/make.bat b/make.bat index 8e60811ccf..c4497fa3b6 100644 --- a/make.bat +++ b/make.bat @@ -7,7 +7,7 @@ rem psutil ("make.bat build", "make.bat install") and running tests rem ("make.bat test"). rem rem This script is modeled after my Windows installation which uses: -rem - Visual studio 2008 for Python 2.6, 2.7 +rem - Visual studio 2008 for Python 2.7 rem - Visual studio 2010 for Python 3.4+ rem ...therefore it might not work on your Windows installation. rem diff --git a/psutil/_common.py b/psutil/_common.py index 16d3b3b56e..6d034c56be 100644 --- a/psutil/_common.py +++ b/psutil/_common.py @@ -279,10 +279,7 @@ class Error(Exception): __module__ = 'psutil' def _infodict(self, attrs): - try: - info = collections.OrderedDict() - except AttributeError: # pragma: no cover - info = {} # Python 2.6 + info = collections.OrderedDict() for name in attrs: value = getattr(self, name, None) if value: diff --git a/psutil/tests/test_process.py b/psutil/tests/test_process.py index c9059e3363..0f1a534a29 100755 --- a/psutil/tests/test_process.py +++ b/psutil/tests/test_process.py @@ -1556,7 +1556,7 @@ def test_kill_terminate(self): self.assertRaises(psutil.NoSuchProcess, proc.kill) self.assertRaises(psutil.NoSuchProcess, proc.send_signal, signal.SIGTERM) - if WINDOWS and sys.version_info >= (2, 7): + if WINDOWS: self.assertRaises(psutil.NoSuchProcess, proc.send_signal, signal.CTRL_C_EVENT) self.assertRaises(psutil.NoSuchProcess, proc.send_signal, diff --git a/psutil/tests/test_windows.py b/psutil/tests/test_windows.py index ea694be4a4..e422530686 100755 --- a/psutil/tests/test_windows.py +++ b/psutil/tests/test_windows.py @@ -337,8 +337,6 @@ def test_num_handles_increment(self): win32api.CloseHandle(handle) self.assertEqual(p.num_handles(), before) - @unittest.skipIf(not sys.version_info >= (2, 7), - "CTRL_* signals not supported") def test_ctrl_signals(self): p = psutil.Process(self.spawn_testproc().pid) p.send_signal(signal.CTRL_C_EVENT) diff --git a/scripts/internal/print_announce.py b/scripts/internal/print_announce.py index c9948c1d9f..1c22b1c1d2 100755 --- a/scripts/internal/print_announce.py +++ b/scripts/internal/print_announce.py @@ -47,7 +47,7 @@ nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap. It \ currently supports Linux, Windows, macOS, Sun Solaris, FreeBSD, OpenBSD, \ NetBSD and AIX, both 32-bit and 64-bit architectures. Supported Python \ -versions are 2.6, 2.7 and 3.4+. PyPy is also known to work. +versions are 2.7 and 3.4+. PyPy is also known to work. What's new ========== diff --git a/setup.py b/setup.py index 7521d08e1d..c76028833b 100755 --- a/setup.py +++ b/setup.py @@ -386,7 +386,6 @@ def main(): 'Operating System :: POSIX', 'Programming Language :: C', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: Implementation :: CPython', @@ -408,7 +407,7 @@ def main(): ) if setuptools is not None: kwargs.update( - python_requires=">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", + python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", extras_require=extras_require, zip_safe=False, )