python3: move from using func_name to __name__
Previously reviewed as D964, but required some fixups and therefore
seems to need a new revision.
Differential Revision: https://phab.mercurial-scm.org/D1065
public attributes not in abstract interface: badpeer.badattributepublic attributes not in abstract interface: badpeer.badmethod