async = kwargs.pop('async', False)
if async:
p = Pipeline(cmd, **kwargs)
p.run(input=input, async=True)
else:
with Pipeline(cmd, **kwargs) as p:
p.run(input=input, async=async)
return p
I find it hard to see how that code could return anything other than a Pipeline instance.
Regards,
Vinay Sajip