aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py9
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',