diff options
author | Pyfisch <pyfisch@gmail.com> | 2018-11-06 20:08:08 +0100 |
---|---|---|
committer | Pyfisch <pyfisch@gmail.com> | 2018-11-06 22:30:31 +0100 |
commit | 4a947dd7195c3ece1e4996a6bdf7c300bf6ec655 (patch) | |
tree | eb3cdb5e6a99aeb8e61b83c148b560933269177c /python/servo/testing_commands.py | |
parent | 095d446ccda70c3174c31afe545bb11c22cf43be (diff) | |
download | servo-4a947dd7195c3ece1e4996a6bdf7c300bf6ec655.tar.gz servo-4a947dd7195c3ece1e4996a6bdf7c300bf6ec655.zip |
Remove import order check from test-tidy
Fix leaking file descriptor.
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 0e0c23baefc..771d1746351 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -305,10 +305,11 @@ class MachCommands(CommandBase): return 0 def install_rustfmt(self): - if self.call_rustup_run(["cargo", "fmt", "--version", "-q"], - stderr=open(os.devnull, "w")) != 0: - # Rustfmt is not installed. Install: - self.call_rustup_run(["rustup", "component", "add", "rustfmt-preview"]) + with open(os.devnull, "w") as devnull: + if self.call_rustup_run(["cargo", "fmt", "--version", "-q"], + stderr=devnull) != 0: + # Rustfmt is not installed. Install: + self.call_rustup_run(["rustup", "component", "add", "rustfmt-preview"]) @Command('test-tidy', description='Run the source code tidiness check', |