Mercurial > public > mercurial-scm > hg
diff mercurial/pycompat.py @ 36178:646002338365
py3: introduce and use pycompat.getargspec
This is getfullargspec on py3, which means we can't use namedtuple
named accessors for all fields (eg keywords from getargspec is varkw
from getfullargspec, with the same meaning). Solves some warning
issues on Python 3.
I didn't clean up httpclient because that's vendored code I think we
should probably discard, and I didn't touch the manpage generator for
now either.
Differential Revision: https://phab.mercurial-scm.org/D2251
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 13 Feb 2018 23:00:01 -0700 |
parents | 04984f2e50ae |
children | b44fac3a49fb |
line wrap: on
line diff
--- a/mercurial/pycompat.py Tue Feb 13 23:37:58 2018 -0500 +++ b/mercurial/pycompat.py Tue Feb 13 23:00:01 2018 -0700 @@ -11,6 +11,7 @@ from __future__ import absolute_import import getopt +import inspect import os import shlex import sys @@ -65,6 +66,7 @@ maplist = lambda *args: list(map(*args)) ziplist = lambda *args: list(zip(*args)) rawinput = input + getargspec = inspect.getfullargspec # TODO: .buffer might not exist if std streams were replaced; we'll need # a silly wrapper to make a bytes stream backed by a unicode one. @@ -330,6 +332,7 @@ maplist = map ziplist = zip rawinput = raw_input + getargspec = inspect.getargspec def emailparser(*args, **kwargs): import email.parser