diff mercurial/hgweb.py @ 1087:3a1a46dcd397

hgweb: add catch for connection reset suggested by Jeff Sipek
author mpm@selenic.com
date Sat, 27 Aug 2005 01:55:10 -0700
parents 33f40d0c6124
children 0cb9c72b6c03
line wrap: on
line diff
--- a/mercurial/hgweb.py
+++ b/mercurial/hgweb.py
@@ -73,7 +73,11 @@ def write(*things):
             for part in thing:
                 write(part)
         else:
-            sys.stdout.write(str(thing))
+            try:
+                sys.stdout.write(str(thing))
+            except socket.error, x:
+                if x[0] != errno.ECONNRESET:
+                    raise
 
 class templater:
     def __init__(self, mapfile, filters={}, defaults={}):