( )⚙ D9377 tests: make test-worker.t pass on py2

This is an archive of the discontinued Mercurial Phabricator instance.

tests: make test-worker.t pass on py2
ClosedPublic

Authored by martinvonz on Nov 23 2020, 3:18 PM.

Details

Summary

I broke the py2 version in https://phab.mercurial-scm.org/D9287
because the WorkerError.__bytes__() (or .__str__()?) output was
different in py2 compared to py3. Part of the problem was that I
didn't propagate the status code that was passed in to the superclass
so it could get printed. This patch fixes that. I don't know how it
worked on py3 before this patch...

I also added the usual __bytes__ = _tobytes override for good
measure. It doesn't seem to be needed for tests to pass, though.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Nov 23 2020, 3:18 PM

Thanks for tackling this.

marmoute accepted this revision.Nov 24 2020, 12:40 PM
mharbison72 accepted this revision.Nov 24 2020, 4:33 PM
This revision is now accepted and ready to land.Nov 24 2020, 4:33 PM
This revision was automatically updated to reflect the committed changes.