From 1dfb08a891606ef2dea1a439a083f9e0c0fc82f0 Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Fri, 17 Jan 2025 20:52:22 +0100 Subject: [PATCH] Allow to install on Python 3.4 --- docs/source/install.rst | 2 +- pwnlib/libcdb.py | 3 ++- pyproject.toml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/source/install.rst b/docs/source/install.rst index dfc0da91e..91868f09e 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -21,7 +21,7 @@ Note: For Mac OS X you will need to have cmake ``brew install cmake`` and pkg-co Released Version ----------------- -pwntools is available as a ``pip`` package for both Python2 and Python3. +pwntools is available as a ``pip`` package for Python3. Version v5.0.0 requires Python3.10 or later. Python3 ^^^^^^^ diff --git a/pwnlib/libcdb.py b/pwnlib/libcdb.py index 909f5aeaa..4f00e677e 100644 --- a/pwnlib/libcdb.py +++ b/pwnlib/libcdb.py @@ -9,6 +9,7 @@ import six import tempfile import struct +import sys from pwnlib.context import context from pwnlib.elf import ELF @@ -498,7 +499,7 @@ def _extract_tarfile(cache_dir, data_filename, tarball): def _extract_debfile(cache_dir, package_filename, package): # Extract data.tar in the .deb archive. - if six.PY2: + if sys.version_info < (3, 6): if not which('ar'): log.error('Missing command line tool "ar" to extract .deb archive. Please install "ar" first.') diff --git a/pyproject.toml b/pyproject.toml index b0672e532..a5b493d22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ classifiers = [ ] keywords = ["pwntools", "exploit", "ctf", "capture", "the", "flag", "binary", "wargame", "overflow", "stack", "heap", "defcon"] -requires-python = ">=3.10" +requires-python = ">=3.4" dependencies = [ "paramiko>=1.15.2", "mako>=1.0.0", @@ -52,7 +52,7 @@ dependencies = [ "six>=1.12.0", "rpyc", "colored_traceback", - "unix-ar", + "unix-ar; python_version>='3.6'", "zstandard", ]