From 6ad24f64d820955923c9c436e7dc74ec8b476939 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 14 Sep 2023 22:32:33 +0200 Subject: [PATCH] handle errors on write, too, courtesy of @luarvique --- csdr/module/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/csdr/module/__init__.py b/csdr/module/__init__.py index 131d6c16..1e1b3525 100644 --- a/csdr/module/__init__.py +++ b/csdr/module/__init__.py @@ -45,7 +45,10 @@ class Module(BaseModule, metaclass=ABCMeta): break if data is None or isinstance(data, bytes) and len(data) == 0: break - write(data) + try: + write(data) + except BrokenPipeError: + break return copy