Re: [PATCH 3/6] git-p4: Removed support for Python 2
- From
David Aguilar <davvid@gmail.com>
- Date
- Dec 10, 2021, 03:25 UTC
- Message-ID
- <CAJDDKr5N-2WUaspsyciq3WW+pMW--Mjiu5+3F_gOmHYENAkCUA@mail.gmail.com>
- In-Reply-To
- <20211209201029.136886-4-jholdsworth@nvidia.com>
On Thu, Dec 9, 2021 at 1:13 PM Joel Holdsworth <jholdsworth@nvidia.com> wrote:
Show 27 quoted lines
>
> Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
> ---
> git-p4.py | 89 +++++++++++++++++--------------------------------------
> 1 file changed, 28 insertions(+), 61 deletions(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index 32f30e5f9a..b5d4fc1176 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python3
> #
> # git-p4.py -- A tool for bidirectional operation between a Perforce depot and git.
> #
> @@ -16,8 +16,8 @@
> # pylint: disable=too-many-branches,too-many-nested-blocks
> #
> import sys
> -if sys.version_info.major < 3 and sys.version_info.minor < 7:
> - sys.stderr.write("git-p4: requires Python 2.7 or later.\n")
> +if sys.version_info.major < 3 or (sys.version_info.major == 3 and sys.version_info.minor < 7):
> + sys.stderr.write("git-p4: requires Python 3.7 or later.\n")
> sys.exit(1)
> import os
> import optparseThere are pretty large user bases on centos/rhel 7+8 where python3.6 is the default version.
If we don't necessarily require any features from 3.7 then it might be worth lowering this constraint to allow 3.6 or maybe even 3.4 to maximize the number of users that would benefit.
I realize these python versions are retired according to the python core team, but I tend to be a little more sympathetic to users when it doesn't have any impact on the code.
-- David