Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Py2 support #121

Merged
merged 1 commit into from
Sep 25, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ matrix:
- "node"

- language: python
python: 3.4
python: 2.7
install: "pip install -r requirements.txt"
script:
- pep8 .
Expand Down
17 changes: 9 additions & 8 deletions run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

import argparse
import configparser
import ConfigParser as configparser
import gzip
import json
import platform as host_platform
Expand Down Expand Up @@ -60,7 +60,6 @@


def main(platform_id, platform, args, config):
assert sys.version_info.major == 3, 'This script requires Python 3.'

print('PLATFORM_ID:', platform_id)
print('PLATFORM INFO:', platform)
Expand Down Expand Up @@ -133,7 +132,7 @@ def main(platform_id, platform, args, config):
config['gs_results_bucket'], SUMMARY_PATH
)

if config.getboolean('install_wptrunner'):
if config.get('install_wptrunner'):
print('==================================================')
print('Installing wptrunner')
command = ['pip', 'install', '--user', '-e', 'tools/wptrunner']
Expand Down Expand Up @@ -185,7 +184,6 @@ def main(platform_id, platform, args, config):

if args.path:
command.append(args.path)

return_code = subprocess.call(command, cwd=config['wpt_path'])

print('==================================================')
Expand Down Expand Up @@ -343,7 +341,7 @@ def write_gzip_json(filepath, payload):

with gzip.open(filepath, 'wb') as f:
payload_str = json.dumps(payload)
f.write(bytes(payload_str, 'UTF-8'))
f.write(payload_str, 'UTF-8')


def verify_gsutil_installed(config):
Expand All @@ -369,8 +367,11 @@ def get_config():
config.set('default',
key,
os.path.expandvars(config.get('default', key)))

return config['default']
conf = {}
for item in config.items('default'):
k, v = item
conf[k] = v
return conf


def patch_wpt(config, platform):
Expand All @@ -394,7 +395,7 @@ def patch_wpt(config, platform):
p = subprocess.Popen(
['git', 'apply', '-'], cwd=config['wpt_path'], stdin=subprocess.PIPE
)
p.communicate(input=bytes(patch, 'utf-8'))
p.communicate(input=patch)


def parse_args():
Expand Down
2 changes: 1 addition & 1 deletion run/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import unittest

from run.run import (
from run import (
report_to_summary,
version_string_to_major_minor
)
Expand Down