summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
Diffstat (limited to 'pygments')
-rw-r--r--pygments/cmdline.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pygments/cmdline.py b/pygments/cmdline.py
index f25b1e83..1fdf335a 100644
--- a/pygments/cmdline.py
+++ b/pygments/cmdline.py
@@ -638,6 +638,9 @@ def main(args=sys.argv):
try:
return main_inner(parser, argns)
+ except BrokenPipeError:
+ # someone closed our stdout, e.g. by quitting a pager.
+ return 0
except Exception:
if argns.v:
print(file=sys.stderr)