mercurial/extensions.py
changeset 31263 d79761fe697f
parent 31074 2912b06905dc
child 31264 063d7957fa12
--- 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