]> git.lizzy.rs Git - rust.git/commitdiff
Guard against USER not existing in the environment
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Thu, 2 Feb 2017 21:28:00 +0000 (22:28 +0100)
committerDirkjan Ochtman <dirkjan@ochtman.nl>
Thu, 2 Feb 2017 21:28:00 +0000 (22:28 +0100)
src/bootstrap/bootstrap.py

index 958ffd11008a345ca29f9e265fcd7a29553a0ee6..3869b286102c9c5a743420b11e1fd960d35085c4 100644 (file)
@@ -439,7 +439,7 @@ def main():
                               'CFG_ENABLE_VENDOR' in rb.config_mk
 
     if 'SUDO_USER' in os.environ and not rb.use_vendored_sources:
-        if os.environ['USER'] != os.environ['SUDO_USER']:
+        if os.environ.get('USER') != os.environ['SUDO_USER']:
             rb.use_vendored_sources = True
             print('info: looks like you are running this command under `sudo`')
             print('      and so in order to preserve your $HOME this will now')