extensions: use inspect module instead of func_code.co_argcount
Fixes the extsetup argspec check on Python 3.
--- 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