DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
authorLaurent Peuch <cortex@worlddomination.be>
Thu, 11 Apr 2019 20:15:09 +0200
changeset 12571 eba09a2ac61d
parent 12570 82bf85157b53
child 12572 9850a9b86c92
DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
cubicweb/dataimport/stores.py
cubicweb/devtools/fill.py
--- a/cubicweb/dataimport/stores.py	Thu Apr 11 16:47:27 2019 +0200
+++ b/cubicweb/dataimport/stores.py	Thu Apr 11 20:15:09 2019 +0200
@@ -188,7 +188,7 @@
         self._system_source.add_info(cnx, entity, entity_source)
         self._system_source.add_entity(cnx, entity)
         kwargs = dict()
-        if inspect.getargspec(self._add_relation).keywords:
+        if inspect.getfullargspec(self._add_relation).varkw:
             kwargs['subjtype'] = entity.cw_etype
         for rtype, targeteids in rels.items():
             # targeteids may be a single eid or a list of eids
--- a/cubicweb/devtools/fill.py	Thu Apr 11 16:47:27 2019 +0200
+++ b/cubicweb/devtools/fill.py	Thu Apr 11 20:15:09 2019 +0200
@@ -258,7 +258,7 @@
         for attrname, attrvalue in classdict.items():
             if callable(attrvalue):
                 if attrname.startswith('generate_') and \
-                       len(inspect.getargspec(attrvalue).args) < 2:
+                       len(inspect.getfullargspec(attrvalue).args) < 2:
                     raise TypeError('generate_xxx must accept at least 1 argument')
                 setattr(_ValueGenerator, attrname, attrvalue)
         return type.__new__(mcs, name, bases, classdict)