From 477b349f375ca9767032bd2e3992f99303c15868 Mon Sep 17 00:00:00 2001 From: John Pfuntner Date: Wed, 21 Oct 2020 10:51:03 -0400 Subject: [PATCH] Avoiding SIGPIPE in recent Python 3 interpreters I had seen this error on recent interpreters on Windows and opened #83 to address it globally. --- bin/table.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/table.py b/bin/table.py index 5e1cd6d9..b9cad4ee 100755 --- a/bin/table.py +++ b/bin/table.py @@ -8,6 +8,7 @@ import signal import logging import argparse +import platform import io import xml.etree.ElementTree as ET @@ -901,7 +902,8 @@ def sorter(a, b): log.setLevel(logging.DEBUG if args.verbose else logging.WARNING) -signal.signal(signal.SIGPIPE, lambda signum, stack_frame: exit(0)) +if 'win' not in platform.platform().lower(): + signal.signal(signal.SIGPIPE, lambda signum, stack_frame: exit(0)) if args.loose_headings: args.headings = True