Skip to content

CLN: Remove unnecessary sys.version_info checks #29210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 25, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/tests/io/formats/test_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
11 changes: 6 additions & 5 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* 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
* [![Latest Version]
(https://pypip.in/version/versioneer/badge.svg?style=flat)
](https://pypi.org/project/versioneer/)
Expand Down Expand Up @@ -464,9 +463,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)
Expand Down Expand Up @@ -561,9 +561,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)
Expand Down