Show More
@@ -136,6 +136,11 b' def import_keyring():' | |||||
136 | "ctypes", |
|
136 | "ctypes", | |
137 | "secretstorage.exceptions", |
|
137 | "secretstorage.exceptions", | |
138 | "fs.opener", |
|
138 | "fs.opener", | |
|
139 | "win32ctypes.pywin32", | |||
|
140 | "win32ctypes.pywin32.pywintypes", | |||
|
141 | "win32ctypes.pywin32.win32cred", | |||
|
142 | "pywintypes", | |||
|
143 | "win32cred", | |||
139 | ]) |
|
144 | ]) | |
140 | if was_imported_now: |
|
145 | if was_imported_now: | |
141 | # Shut up warning about uninitialized logging by keyring |
|
146 | # Shut up warning about uninitialized logging by keyring | |
@@ -416,7 +421,7 b' class HTTPPasswordHandler(object):' | |||||
416 | _debug(ui, _("Saving password for %s to keyring") % user) |
|
421 | _debug(ui, _("Saving password for %s to keyring") % user) | |
417 | try: |
|
422 | try: | |
418 | password_store.set_http_password(final_url, user, pwd) |
|
423 | password_store.set_http_password(final_url, user, pwd) | |
419 |
except Exception |
|
424 | except Exception as e: | |
420 | keyring = import_keyring() |
|
425 | keyring = import_keyring() | |
421 | if isinstance(e, keyring.errors.PasswordSetError): |
|
426 | if isinstance(e, keyring.errors.PasswordSetError): | |
422 | ui.traceback() |
|
427 | ui.traceback() | |
@@ -616,7 +621,7 b' def try_smtp_login(ui, smtp_obj, usernam' | |||||
616 | (username)) |
|
621 | (username)) | |
617 | smtp_obj.login(username, password) |
|
622 | smtp_obj.login(username, password) | |
618 | return True |
|
623 | return True | |
619 |
except smtplib.SMTPException |
|
624 | except smtplib.SMTPException as inst: | |
620 | if inst.smtp_code == 535: |
|
625 | if inst.smtp_code == 535: | |
621 | ui.status(_("SMTP login failed: %s\n\n") % inst.smtp_error) |
|
626 | ui.status(_("SMTP login failed: %s\n\n") % inst.smtp_error) | |
622 | return False |
|
627 | return False | |
@@ -635,7 +640,6 b' def keyring_supported_smtp(ui, username)' | |||||
635 | >>>>> and # <<<<< markers, there are also some fixes which make |
|
640 | >>>>> and # <<<<< markers, there are also some fixes which make | |
636 | the code working on various Mercurials (like parsebool import). |
|
641 | the code working on various Mercurials (like parsebool import). | |
637 | """ |
|
642 | """ | |
638 |
|
||||
639 | try: |
|
643 | try: | |
640 | from mercurial.utils.stringutil import parsebool |
|
644 | from mercurial.utils.stringutil import parsebool | |
641 | except ImportError: |
|
645 | except ImportError: | |
@@ -710,10 +714,10 b' def keyring_supported_smtp(ui, username)' | |||||
710 | def send(sender, recipients, msg): |
|
714 | def send(sender, recipients, msg): | |
711 | try: |
|
715 | try: | |
712 | return s.sendmail(sender, recipients, msg) |
|
716 | return s.sendmail(sender, recipients, msg) | |
713 |
except smtplib.SMTPRecipientsRefused |
|
717 | except smtplib.SMTPRecipientsRefused as inst: | |
714 | recipients = [r[1] for r in inst.recipients.values()] |
|
718 | recipients = [r[1] for r in inst.recipients.values()] | |
715 | raise error.Abort('\n' + '\n'.join(recipients)) |
|
719 | raise error.Abort('\n' + '\n'.join(recipients)) | |
716 |
except smtplib.SMTPException |
|
720 | except smtplib.SMTPException as inst: | |
717 | raise error.Abort(inst) |
|
721 | raise error.Abort(inst) | |
718 |
|
722 | |||
719 | return send |
|
723 | return send |
General Comments 0
You need to be logged in to leave comments.
Login now