Skip to content
Browse files

Handle missing signal.SIGPIPE more generically

  • Loading branch information...
1 parent f862e82 commit eb8f123fcc673d27eb06102b3fcac99624a6fc5b @myint myint committed
Showing with 6 additions and 3 deletions.
  1. +1 −0 AUTHORS
  2. +5 −3 autopep8.py
View
1 AUTHORS
@@ -15,3 +15,4 @@ Patches, Bug Reports, and Suggestions
- Andras Tim (https://github.com/andras-tim)
- tomscytale (https://github.com/tomscytale)
- Filip Noetzel (https://github.com/peritus)
+- Erik Bray (https://github.com/iguananaut)
View
8 autopep8.py
@@ -2247,10 +2247,12 @@ def is_python_file(filename):
def main():
"""Tool main."""
- # Exit on broken pipe.
-
- if sys.platform != 'win32':
+ try:
+ # Exit on broken pipe.
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+ except AttributeError:
+ # SIGPIPE is not available on Windows.
+ pass # pragma: no cover
try:
options, args = parse_args(sys.argv[1:])

0 comments on commit eb8f123

Please sign in to comment.
Something went wrong with that request. Please try again.