aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwayling <waylingII@gmail.com>2018-07-28 21:59:06 +0800
committerwayling <waylingII@gmail.com>2018-07-28 21:59:06 +0800
commit2ad37bda2c58cd8b79c645316bd1e4580a881a37 (patch)
treeca4942b21d8c7a2c668a6c7f568b3c36c53fcb78
parente2fca1b228ff20d54b67e0d1fa502b694b5c290e (diff)
downloadservo-2ad37bda2c58cd8b79c645316bd1e4580a881a37.tar.gz
servo-2ad37bda2c58cd8b79c645316bd1e4580a881a37.zip
"./mach env" cause unclear message
Use the "get" instead to avoid the error.
-rw-r--r--python/servo/bootstrap_commands.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py
index b422a553003..ce4e12381e0 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -38,12 +38,12 @@ class MachCommands(CommandBase):
category='bootstrap')
def env(self):
env = self.build_env()
- print("export RUSTFLAGS=%s" % env["RUSTFLAGS"])
- print("export PATH=%s" % env["PATH"])
+ print("export RUSTFLAGS=%s" % env.get("RUSTFLAGS", ""))
+ print("export PATH=%s" % env.get("PATH", ""))
if sys.platform == "darwin":
- print("export DYLD_LIBRARY_PATH=%s" % env["DYLD_LIBRARY_PATH"])
+ print("export DYLD_LIBRARY_PATH=%s" % env.get("DYLD_LIBRARY_PATH", ""))
else:
- print("export LD_LIBRARY_PATH=%s" % env["LD_LIBRARY_PATH"])
+ print("export LD_LIBRARY_PATH=%s" % env.get("LD_LIBRARY_PATH", ""))
@Command('bootstrap',
description='Install required packages for building.',