fix #6341 - disallow session/config in Node.from_parent

This commit is contained in:
Ronny Pfannschmidt
2019-12-31 20:20:28 +01:00
parent 466bbbf8e8
commit 8ba0b7bc2a
6 changed files with 49 additions and 9 deletions

View File

@@ -679,7 +679,10 @@ class Class(PyCollector):
@classmethod
def from_parent(cls, parent, *, name, obj=None):
return cls._create(name=name, parent=parent)
"""
The public constructor
"""
return super().from_parent(name=name, parent=parent)
def collect(self):
if not safe_getattr(self.obj, "__test__", True):
@@ -1458,8 +1461,11 @@ class Function(FunctionMixin, nodes.Item):
self.originalname = originalname
@classmethod
def from_parent(cls, parent, **kw):
return cls._create(parent=parent, **kw)
def from_parent(cls, parent, **kw): # todo: determine sound type limitations
"""
The public constructor
"""
return super().from_parent(parent=parent, **kw)
def _initrequest(self):
self.funcargs = {}