Skip to content

Commit

Permalink
Remove a few more Python 2-compatibility workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickJadoul committed Feb 3, 2020
1 parent 9b22d39 commit ce7341d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
6 changes: 1 addition & 5 deletions cibuildwheel/bashlex_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,8 @@ def evaluate_word_node(node, context):
def evaluate_command_node(node, context):
words = [evaluate_node(part, context=context) for part in node.parts]
command = ' '.join(words)
output = subprocess.check_output(shlex.split(command), env=context.environment)
return subprocess.check_output(shlex.split(command), env=context.environment, universal_newlines=True)

if sys.version_info[0] >= 3:
return output.decode('utf8', 'replace')
else:
return output

def evaluate_parameter_node(node, context):
return context.environment.get(node.value, '')
4 changes: 1 addition & 3 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ def build(project_dir, output_dir, test_command, test_requires, test_extras, bef
get_pip_url = 'https://bootstrap.pypa.io/get-pip.py'
get_pip_script = '/tmp/get-pip.py'

pkgs_output = subprocess.check_output(['pkgutil', '--pkgs'])
if sys.version_info[0] >= 3:
pkgs_output = pkgs_output.decode('utf8')
pkgs_output = subprocess.check_output(['pkgutil', '--pkgs'], universal_newlines=True)
installed_system_packages = pkgs_output.splitlines()

def call(args, env=None, cwd=None, shell=False):
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, io

Expand Down

0 comments on commit ce7341d

Please sign in to comment.