From 982db82559ce268d5d1ba1bb80b71ca02bf2917c Mon Sep 17 00:00:00 2001 From: gfyoung Date: Thu, 24 Oct 2019 18:27:47 +0000 Subject: [PATCH 1/3] CLN: Remove unnecessary sys.version_info checks --- pandas/tests/io/formats/test_to_csv.py | 2 +- versioneer.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pandas/tests/io/formats/test_to_csv.py b/pandas/tests/io/formats/test_to_csv.py index a85f3677bc3ab..095dfb7876154 100644 --- a/pandas/tests/io/formats/test_to_csv.py +++ b/pandas/tests/io/formats/test_to_csv.py @@ -11,7 +11,7 @@ class TestToCSV: @pytest.mark.xfail( - (3, 6, 5) > sys.version_info >= (3, 5), + (3, 6, 5) > sys.version_info, reason=("Python csv library bug (see https://bugs.python.org/issue32255)"), ) def test_to_csv_with_single_column(self): diff --git a/versioneer.py b/versioneer.py index 24d8105c307c0..1d2d2880be3b8 100644 --- a/versioneer.py +++ b/versioneer.py @@ -8,7 +8,7 @@ * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain -* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, and pypy +* Compatible With: python3.5+, and pypy * [![Latest Version] (https://pypip.in/version/versioneer/badge.svg?style=flat) ](https://pypi.org/project/versioneer/) @@ -464,9 +464,10 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False): if verbose: print("unable to find command, tried %s" % (commands,)) return None + stdout = p.communicate()[0].strip() - if sys.version_info[0] >= 3: - stdout = stdout.decode() + stdout = stdout.decode() + if p.returncode != 0: if verbose: print("unable to run %s (error)" % dispcmd) @@ -561,9 +562,10 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False): if verbose: print("unable to find command, tried %%s" %% (commands,)) return None + stdout = p.communicate()[0].strip() - if sys.version_info[0] >= 3: - stdout = stdout.decode() + stdout = stdout.decode() + if p.returncode != 0: if verbose: print("unable to run %%s (error)" %% dispcmd) From 544e1d864ff60657e358970d4c549af3d9091ad3 Mon Sep 17 00:00:00 2001 From: gfyoung Date: Fri, 25 Oct 2019 03:26:55 +0000 Subject: [PATCH 2/3] CLN: Drop compatiblity line from versioneer We can safely assume this file is going to be (or should be) compatible with whatever Python versions pandas itself supports. --- versioneer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/versioneer.py b/versioneer.py index 1d2d2880be3b8..b096ca41485f1 100644 --- a/versioneer.py +++ b/versioneer.py @@ -8,7 +8,6 @@ * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain -* Compatible With: python3.5+, and pypy * [![Latest Version] (https://pypip.in/version/versioneer/badge.svg?style=flat) ](https://pypi.org/project/versioneer/) From 89a0f33f908e2c41c33f4f66790cb058cccfd43c Mon Sep 17 00:00:00 2001 From: gfyoung Date: Fri, 25 Oct 2019 07:03:56 +0000 Subject: [PATCH 3/3] CLN: Mollify the mypy for typing --- versioneer.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/versioneer.py b/versioneer.py index b096ca41485f1..8a4710da5958a 100644 --- a/versioneer.py +++ b/versioneer.py @@ -464,8 +464,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False): print("unable to find command, tried %s" % (commands,)) return None - stdout = p.communicate()[0].strip() - stdout = stdout.decode() + stdout = p.communicate()[0].strip().decode() if p.returncode != 0: if verbose: @@ -562,8 +561,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False): print("unable to find command, tried %%s" %% (commands,)) return None - stdout = p.communicate()[0].strip() - stdout = stdout.decode() + stdout = p.communicate()[0].strip().decode() if p.returncode != 0: if verbose: