Update pep8.py
authorlordhellcito <rsc212@hotmail.com>
Sun, 27 Apr 2014 13:51:46 +0000 (15:51 +0200)
committerlordhellcito <rsc212@hotmail.com>
Sun, 27 Apr 2014 13:51:46 +0000 (15:51 +0200)
Windows throws an AttributeError exception instead ValueError when calls signal.SIGPIPE.

pep8.py

diff --git a/pep8.py b/pep8.py
index a254716570670ad93d588a01eee89599437a9838..0671ac7f513f6387d7b21277068df6274cf57e4c 100755 (executable)
--- a/pep8.py
+++ b/pep8.py
@@ -1918,7 +1918,7 @@ def _main():
     # Handle "Broken pipe" gracefully
     try:
         signal.signal(signal.SIGPIPE, lambda signum, frame: sys.exit(1))
-    except ValueError:
+    except AttributeError:
         pass    # not supported on Windows
 
     pep8style = StyleGuide(parse_argv=True, config_file=True)