#NEWLINE# def get_password( username , interactive = sys . stdout . isatty ( ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return get_password_from_keyring ( interactive ) #NEWLINE# #UNINDENT# except NoStoredPasswordAvailable : #NEWLINE# #INDENT# if ( not interactive ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# return getpass . getpass ( 'Enter iCloud password for {username}: ' . format ( username = username ) )