Skip to content
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

Make bptestrunner work with python 2 and python 3 #362

Merged
merged 1 commit into from
Sep 25, 2019
Merged
Changes from all 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
15 changes: 10 additions & 5 deletions bptestrunner/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,18 @@ def merge_config_files(config1, config2):
logging.debug("Merging '{}' '{}'".format(config1, config2))
cfg1 = {}
if config1:
with open(config1) as f:
with open(config1, 'r') as f:
cfg1 = json.load(f)
cfg2 = {}
if config2:
with open(config2) as f:
with open(config2, 'r') as f:
cfg2 = json.load(f)
merged_cfg = {key: value for (key, value) in (cfg2.items() + cfg1.items())}
f = tempfile.NamedTemporaryFile(delete=False)
merged_cfg = {}
for key, value in cfg2.items():
merged_cfg[key] = value
for key, value in cfg1.items():
merged_cfg[key] = value
f = tempfile.NamedTemporaryFile(mode='w+', delete=False)
json.dump(merged_cfg, f)
f.close()
logging.debug("merged cfg file: {}".format(f.name))
Expand All @@ -94,7 +98,8 @@ def merge_config_files(config1, config2):
def find_xcode_path():
"""Return the path to Xcode's Developer directory.
"""
simctl_path = subprocess.check_output(['xcrun', '--find', 'simctl'])
simctl_path = subprocess.check_output(
['xcrun', '--find', 'simctl']).decode('utf-8')
xcode_path = simctl_path.replace('/usr/bin/simctl', '')
return xcode_path.rstrip()

Expand Down