comparison mercurial/hgweb.py @ 1174:9d9f4973c76a

Added missing 'import errno', and use errno for EPIPE, too.
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 31 Aug 2005 09:01:41 +0200
parents 3f30a5e7e15b
children 24d553b598e8
comparison
equal deleted inserted replaced
1173:bc9695f1f872 1174:9d9f4973c76a
4 # Copyright 2005 Matt Mackall <mpm@selenic.com> 4 # Copyright 2005 Matt Mackall <mpm@selenic.com>
5 # 5 #
6 # This software may be used and distributed according to the terms 6 # This software may be used and distributed according to the terms
7 # of the GNU General Public License, incorporated herein by reference. 7 # of the GNU General Public License, incorporated herein by reference.
8 8
9 import os, cgi, time, re, socket, sys, zlib 9 import os, cgi, time, re, socket, sys, zlib, errno
10 import mdiff 10 import mdiff
11 from hg import * 11 from hg import *
12 from ui import * 12 from ui import *
13 13
14 14
75 else: 75 else:
76 try: 76 try:
77 self.out.write(thing) 77 self.out.write(thing)
78 except TypeError: 78 except TypeError:
79 self.out.write(str(thing)) 79 self.out.write(str(thing))
80 except socket.error, x: 80 except socket.error, inst:
81 if x[0] != errno.ECONNRESET: 81 if inst[0] != errno.ECONNRESET:
82 raise 82 raise
83 83
84 def header(self, headers=[('Content-type','text/html')]): 84 def header(self, headers=[('Content-type','text/html')]):
85 for header in headers: 85 for header in headers:
86 self.out.write("%s: %s\r\n" % header) 86 self.out.write("%s: %s\r\n" % header)
867 867
868 def do_POST(self): 868 def do_POST(self):
869 try: 869 try:
870 self.do_hgweb() 870 self.do_hgweb()
871 except socket.error, inst: 871 except socket.error, inst:
872 if inst.args[0] != 32: 872 if inst[0] != errno.EPIPE:
873 raise 873 raise
874 874
875 def do_GET(self): 875 def do_GET(self):
876 self.do_POST() 876 self.do_POST()
877 877