# HG changeset patch # User Steve Borho # Date 2009-02-21 23:46:06 # Node ID 57fee79e5588cc268a4f044c0a5e45c65d014f50 # Parent e48cc2315fe644cb2f02a3bb209626b75727b86b catch CTRL-D at password prompt We caught this exception in ui.prompt(), but not here. Without this, hitting CTRL-D at the password prompt gives a long traceback. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -439,7 +439,10 @@ class ui(object): def getpass(self, prompt=None, default=None): if not self.interactive: return default - return getpass.getpass(prompt or _('password: ')) + try: + return getpass.getpass(prompt or _('password: ')) + except EOFError: + raise util.Abort(_('response expected')) def status(self, *msg): if not self.quiet: self.write(*msg) def warn(self, *msg):