Skip to content

Commit

Permalink
Avoiding SIGPIPE in recent Python 3 interpreters
Browse files Browse the repository at this point in the history
I had seen this error on recent interpreters on Windows and opened #83 to address it globally.
  • Loading branch information
John Pfuntner committed Oct 21, 2020
1 parent cb7f766 commit 477b349
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import signal
import logging
import argparse
import platform
import io
import xml.etree.ElementTree as ET

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 477b349

Please sign in to comment.