Mercurial > public > mercurial-scm > hg-stable
diff mercurial/mail.py @ 52397:bff68b6e5999
mail: stop using the `pycompat.open()` shim
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 04 Dec 2024 20:53:31 -0500 |
parents | f4733654f144 |
children | 9db77d46de79 |
line wrap: on
line diff
--- a/mercurial/mail.py Wed Dec 04 20:52:05 2024 -0500 +++ b/mercurial/mail.py Wed Dec 04 20:53:31 2024 -0500 @@ -28,9 +28,6 @@ ) from .i18n import _ -from .pycompat import ( - open, -) from . import ( encoding, error, @@ -221,7 +218,7 @@ def _mbox(mbox, sender, recipients, msg): '''write mails to mbox''' # TODO: use python mbox library for proper locking - with open(mbox, b'ab+') as fp: + with open(mbox, 'ab+') as fp: # Should be time.asctime(), but Windows prints 2-characters day # of month instead of one. Make them print the same thing. date = time.strftime('%a %b %d %H:%M:%S %Y', time.localtime()) @@ -237,7 +234,7 @@ """make a mail connection. return a function to send mail. call as sendmail(sender, list-of-recipients, msg).""" if mbox: - open(mbox, b'wb').close() + open(mbox, 'wb').close() return lambda s, r, m: _mbox(mbox, s, r, m) if ui.config(b'email', b'method') == b'smtp': return _smtp(ui)