diff --git a/mercurial/hgweb.py b/mercurial/hgweb.py --- a/mercurial/hgweb.py +++ b/mercurial/hgweb.py @@ -6,7 +6,7 @@ # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. -import os, cgi, time, re, socket, sys, zlib +import os, cgi, time, re, socket, sys, zlib, errno import mdiff from hg import * from ui import * @@ -77,8 +77,8 @@ class hgrequest: self.out.write(thing) except TypeError: self.out.write(str(thing)) - except socket.error, x: - if x[0] != errno.ECONNRESET: + except socket.error, inst: + if inst[0] != errno.ECONNRESET: raise def header(self, headers=[('Content-type','text/html')]): @@ -869,7 +869,7 @@ def create_server(repo): try: self.do_hgweb() except socket.error, inst: - if inst.args[0] != 32: + if inst[0] != errno.EPIPE: raise def do_GET(self):