interconnect/stream/Pipeline: Finalize Pipeline if modules are provided during __init__ (for retro-compatibility).

This commit is contained in:
Florent Kermarrec 2023-05-30 08:25:08 +02:00
parent 2a27ca18ea
commit 93b45a687f
1 changed files with 3 additions and 0 deletions

View File

@ -941,8 +941,11 @@ class Pack(Module):
class Pipeline(Module):
def __init__(self, *modules):
self.modules = list(modules)
if len(self.modules):
self.finalize()
def add(self, module):
assert not self.finalized
self.modules.append(module)
def do_finalize(self):