Auto merge of #27007 - saschanaz:py3-flake, r=jdm

Upgrade flake8/pyflakes for Py3 compatibility

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2020-06-21 11:35:20 -04:00 committed by GitHub
commit 3f999ce785
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 377 additions and 357 deletions

View file

@ -75,8 +75,8 @@ class ServoFormatter(base.BaseFormatter):
def text_to_erase_display(self):
if not self.interactive or not self.current_display:
return ""
return ((self.move_up + self.clear_eol) *
self.current_display.count('\n'))
return ((self.move_up + self.clear_eol)
* self.current_display.count('\n'))
def generate_output(self, text=None, new_display=None, unexpected_in_test=None):
if not self.interactive:

View file

@ -19,6 +19,7 @@ def wpt_path(*args):
def servo_path(*args):
return os.path.join(servo_root, *args)
paths = {"include_manifest": wpt_path("include.ini"),
"config": wpt_path("config.ini"),
"ca-cert-path": wpt_path("web-platform-tests/tools/certs/cacert.pem"),
@ -26,8 +27,8 @@ paths = {"include_manifest": wpt_path("include.ini"),
"host-cert-path": wpt_path("web-platform-tests/tools/certs/web-platform.test.pem")}
# Imports
sys.path.append(wpt_path("web-platform-tests", "tools"))
import localpaths # noqa: flake8
from wptrunner import wptrunner, wptcommandline
import localpaths # noqa: F401,E402
from wptrunner import wptrunner, wptcommandline # noqa: E402
def run_tests(**kwargs):
@ -106,5 +107,6 @@ def main():
kwargs = vars(parser.parse_args())
return run_tests(**kwargs)
if __name__ == "__main__":
sys.exit(0 if main() else 1)

View file

@ -5,6 +5,7 @@
import os
import sys
from wptrunner import wptcommandline
from update import updatecommandline
here = os.path.split(__file__)[0]
@ -12,9 +13,6 @@ here = os.path.split(__file__)[0]
def wpt_path(*args):
return os.path.join(here, *args)
# Imports
from update import updatecommandline
def update_tests(**kwargs):
import update
@ -45,5 +43,6 @@ def main():
kwargs = vars(parser.parse_args())
return update_tests(**kwargs)
if __name__ == "__main__":
sys.exit(0 if main() else 1)