Added missing 'import errno', and use errno for EPIPE, too.
authorThomas Arendsen Hein <thomas@intevation.de>
Wed, 31 Aug 2005 09:01:41 +0200
changeset 1174 9d9f4973c76a
parent 1173 bc9695f1f872
child 1176 ba4ce38b90a3
Added missing 'import errno', and use errno for EPIPE, too.
mercurial/hgweb.py
--- a/mercurial/hgweb.py	Wed Aug 31 08:40:55 2005 +0200
+++ b/mercurial/hgweb.py	Wed Aug 31 09:01:41 2005 +0200
@@ -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 @@
                     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 @@
             try:
                 self.do_hgweb()
             except socket.error, inst:
-                if inst.args[0] != 32:
+                if inst[0] != errno.EPIPE:
                     raise
 
         def do_GET(self):