Page MenuHomePhabricator

py3: use email parser that operates on bytes
ClosedPublic

Authored by indygreg on Feb 11 2018, 5:57 PM.

Details

Summary

email.parser.Parser() operates on str in both Python 2 and 3.
Python 3.2 introduced the email.parser.BytesParser(), which works
like Parser except it accepts bytes.

We implement the pycompat helper as a function so we lazily
import the "email" module.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Feb 11 2018, 5:57 PM
This revision was automatically updated to reflect the committed changes.