This is an archive of the discontinued Mercurial Phabricator instance.

py3: make contrib/perf.py compatible to Python 3
AbandonedPublic

Authored by pulkit on Jun 17 2018, 3:20 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

This patch makes contrib/perf.py compatible on Python 3 by using
pycompat.byteskwargs(), pycompat.sysstr(), replacing sys.maxint with sys.maxsize
because sys.maxint is not present on Python 3, adding conditional for
xrange/range and adding a lot of b'' prefixes.

This makes test-contrib-perf.t passes on Python 3.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Jun 17 2018, 3:20 PM
yuja added a subscriber: yuja.Jun 18 2018, 9:04 AM

+ fm.write(b'wall', ' wall %f', m[0])
+ fm.write(b'comb', ' comb %f', m[1] + m[2])
+ fm.write(b'user', ' user %f', m[1])
+ fm.write(b'sys', ' sys %f', m[2])
+ fm.write(b'count', ' (best of %d)', count)

Needs more b''s.

I think it's better to split patches to b'' and the other. I'll send the
patch series that extracts the b'' transformer from the module importer.

pulkit abandoned this revision.Nov 13 2018, 9:08 AM

Not applicable anymore.