mercurial/ui.py
changeset 30814 b96c57c1f860
parent 30641 16b5df5792a8
child 30832 da5fa0f13a41
equal deleted inserted replaced
30813:2cbbd4622ab0 30814:b96c57c1f860
   970         try:
   970         try:
   971             self.write_err(self.label(prompt or _('password: '), 'ui.prompt'))
   971             self.write_err(self.label(prompt or _('password: '), 'ui.prompt'))
   972             # disable getpass() only if explicitly specified. it's still valid
   972             # disable getpass() only if explicitly specified. it's still valid
   973             # to interact with tty even if fin is not a tty.
   973             # to interact with tty even if fin is not a tty.
   974             if self.configbool('ui', 'nontty'):
   974             if self.configbool('ui', 'nontty'):
   975                 return self.fin.readline().rstrip('\n')
   975                 l = self.fin.readline()
       
   976                 if not l:
       
   977                     raise EOFError
       
   978                 return l.rstrip('\n')
   976             else:
   979             else:
   977                 return getpass.getpass('')
   980                 return getpass.getpass('')
   978         except EOFError:
   981         except EOFError:
   979             raise error.ResponseExpected()
   982             raise error.ResponseExpected()
   980     def status(self, *msg, **opts):
   983     def status(self, *msg, **opts):