1. John Paulett
  2. hg-stable-custom

Commits

Steve Borho  committed 57fee79

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.

  • Participants
  • Parent commits e48cc23
  • Branches default

Comments (0)

Files changed (1)

File mercurial/ui.py

View file
 
     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):