# HG changeset patch # User Matt Harbison # Date 2024-12-05 01:53:31 # Node ID bff68b6e5999600f183de7ae90322de63256e595 # Parent 7ac7d5f20cb0cbaa54afe7cb330418897abf2a45 mail: stop using the `pycompat.open()` shim diff --git a/mercurial/mail.py b/mercurial/mail.py --- a/mercurial/mail.py +++ b/mercurial/mail.py @@ -28,9 +28,6 @@ from typing import ( ) from .i18n import _ -from .pycompat import ( - open, -) from . import ( encoding, error, @@ -221,7 +218,7 @@ def _sendmail(ui, sender, recipients, ms 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 @@ def connect(ui, mbox=None): """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)