Skip to content
Permalink
Browse files

fix for #1906

  • Loading branch information
ralsina committed Jul 24, 2015
1 parent 2fb49d6 commit 80a49adb373b0762560c473cff00daa0c50e502b
Showing with 21 additions and 1 deletion.
  1. +21 −1 nikola/plugins/command/auto/__init__.py
@@ -31,6 +31,7 @@
import os
import re
import subprocess
import sys
import time
try:
from urlparse import urlparse
@@ -43,7 +44,7 @@
from blinker import signal
try:
from ws4py.websocket import WebSocket
from ws4py.server.wsgirefserver import WSGIServer, WebSocketWSGIRequestHandler
from ws4py.server.wsgirefserver import WSGIServer, WebSocketWSGIRequestHandler, WebSocketWSGIHandler
from ws4py.server.wsgiutils import WebSocketWSGIApplication
from ws4py.messaging import TextMessage
except ImportError:
@@ -406,3 +407,22 @@ def on_any_event(self, event):
"""Call the provided function on any event."""
if event._src_path == self.configuration_filename:
self.function(event)


# Monkeypatch to hide Broken Pipe Errors

f = WebSocketWSGIHandler.finish_response

if sys.version_info[0] == 3:
EX = BrokenPipeError # NOQA
else:
EX = IOError


def finish_response(self):
try:
f(self)
except EX: # On Python3 this is a BrokenPipeException
pass

WebSocketWSGIHandler.finish_response = finish_response

0 comments on commit 80a49ad

Please sign in to comment.
You can’t perform that action at this time.