mirror of
https://github.com/servo/servo.git
synced 2025-06-28 19:13:41 +01:00
Auto merge of #27005 - saschanaz:py3-tidy, r=jdm
Do not raise StopIteration: PEP 479 <!-- Please describe your changes on the following line: --> This fixes `test-tidy` Py3 compatibility, as [PEP 479](https://www.python.org/dev/peps/pep-0479/) says `return` must be used to stop iteration inside generator instead of `raise StopIteration`. This introduces subtle behavior change where `FileList()` constructor now won't implicitly stop the caller generator when the list is empty. `wpt_lint.py` is modified to explicitly stop when empty, to match the change. --- <!-- 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 - [ ] `./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:
commit
fde47f8937
2 changed files with 24 additions and 29 deletions
|
@ -33,11 +33,13 @@ class Lint(LintRunner):
|
|||
|
||||
wpt_working_dir = os.path.abspath(os.path.join(WPT_PATH, "web-platform-tests"))
|
||||
for suite in SUITES:
|
||||
files = self._get_wpt_files(suite)
|
||||
files = list(self._get_wpt_files(suite))
|
||||
if not files:
|
||||
continue
|
||||
sys.path.insert(0, wpt_working_dir)
|
||||
from tools.lint import lint
|
||||
sys.path.remove(wpt_working_dir)
|
||||
file_dir = os.path.abspath(os.path.join(WPT_PATH, suite))
|
||||
returncode = lint.lint(file_dir, list(files), output_format="json")
|
||||
returncode = lint.lint(file_dir, files, output_format="json")
|
||||
if returncode:
|
||||
yield ("WPT Lint Tool", "", "lint error(s) in Web Platform Tests: exit status %s" % returncode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue