From: Andrej Shadura <andrew.shadura@collabora.co.uk>
Date: Mon, 21 Nov 2022 09:34:19 +0100
Subject: Enable the use of bson impl without dumps

Bug-Debian: https://bugs.debian.org/1024543
---
 reserialize | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/reserialize b/reserialize
index 615cc08..58fbb33 100644
--- a/reserialize
+++ b/reserialize
@@ -83,5 +83,9 @@ if otype not in str_dumpers:
 
 data = fh_loaders[itype](ifh)
 
-data = str_dumpers[otype](data)
-print(data)
+if otype == "bson":
+    ofh = sys.stdout.buffer
+    fh_dumpers[otype](data, ofh)
+else:
+    data = str_dumpers[otype](data)
+    sys.stdout.write(data)
