devtools/fill.py
changeset 10714 8a2ec43fcf44
parent 10704 73367a56ee41
child 11079 eba98431f705
--- a/devtools/fill.py	Fri Sep 18 17:58:30 2015 +0200
+++ b/devtools/fill.py	Tue Sep 22 15:25:25 2015 +0200
@@ -26,6 +26,7 @@
 from copy import deepcopy
 from datetime import datetime, date, time, timedelta
 from decimal import Decimal
+import inspect
 
 from six import text_type, add_metaclass
 from six.moves import range
@@ -258,7 +259,7 @@
         for attrname, attrvalue in classdict.items():
             if callable(attrvalue):
                 if attrname.startswith('generate_') and \
-                       attrvalue.func_code.co_argcount < 2:
+                       len(inspect.getargspec(attrvalue).args) < 2:
                     raise TypeError('generate_xxx must accept at least 1 argument')
                 setattr(_ValueGenerator, attrname, attrvalue)
         return type.__new__(mcs, name, bases, classdict)