def _getpass(prompt):
 import getpass
 try:
  return getpass.getpass(prompt)
 except IOError as e:
  if (e.errno == errno.EINTR):
   raise KeyboardInterrupt
  raise
 except EOFError:
  raise KeyboardInterrupt

def _getpass ( prompt ) : import getpass try : return getpass . getpass ( prompt ) except IOError as e : if ( e . errno == errno . EINTR ) : raise KeyboardInterrupt raise except EOFError : raise KeyboardInterrupt
helper to turn ioerrors into keyboardinterrupts .