Mercurial > hg
diff mercurial/extensions.py @ 31263:d79761fe697f
extensions: use inspect module instead of func_code.co_argcount
Fixes the extsetup argspec check on Python 3.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 03 Mar 2017 13:27:21 -0500 |
parents | 2912b06905dc |
children | 063d7957fa12 |
line wrap: on
line diff
--- a/mercurial/extensions.py Tue Mar 07 18:29:58 2017 -0800 +++ b/mercurial/extensions.py Fri Mar 03 13:27:21 2017 -0500 @@ -8,6 +8,7 @@ from __future__ import absolute_import import imp +import inspect import os from .i18n import ( @@ -150,7 +151,7 @@ try: extsetup(ui) except TypeError: - if extsetup.func_code.co_argcount != 0: + if inspect.getargspec(extsetup).args: raise extsetup() # old extsetup with no ui argument