##// END OF EJS Templates
removed exception args indexing (not supported by py3k)...
Renato Cunha -
r11567:34cc8b84 default
parent child Browse files
Show More
@@ -437,5 +437,5 b' def hook(ui, repo, hooktype, node=None, '
437 437 bz.update(id, ctx)
438 438 bz.notify(ids, util.email(ctx.user()))
439 439 except MySQLdb.MySQLError, err:
440 raise util.Abort(_('database error: %s') % err[1])
440 raise util.Abort(_('database error: %s') % err.args[1])
441 441
@@ -27,11 +27,11 b' def start_server(function):'
27 27 except (OSError, socket.error), err:
28 28 autostart = self.ui.configbool('inotify', 'autostart', True)
29 29
30 if err[0] == errno.ECONNREFUSED:
30 if err.args[0] == errno.ECONNREFUSED:
31 31 self.ui.warn(_('inotify-client: found dead inotify server '
32 32 'socket; removing it\n'))
33 33 os.unlink(os.path.join(self.root, '.hg', 'inotify.sock'))
34 if err[0] in (errno.ECONNREFUSED, errno.ENOENT) and autostart:
34 if err.args[0] in (errno.ECONNREFUSED, errno.ENOENT) and autostart:
35 35 self.ui.debug('(starting inotify server)\n')
36 36 try:
37 37 try:
@@ -49,13 +49,13 b' def start_server(function):'
49 49 return function(self, *args)
50 50 except socket.error, err:
51 51 self.ui.warn(_('inotify-client: could not talk to new '
52 'inotify server: %s\n') % err[-1])
53 elif err[0] in (errno.ECONNREFUSED, errno.ENOENT):
52 'inotify server: %s\n') % err.args[-1])
53 elif err.args[0] in (errno.ECONNREFUSED, errno.ENOENT):
54 54 # silently ignore normal errors if autostart is False
55 55 self.ui.debug('(inotify server not running)\n')
56 56 else:
57 57 self.ui.warn(_('inotify-client: failed to contact inotify '
58 'server: %s\n') % err[-1])
58 'server: %s\n') % err.args[-1])
59 59
60 60 self.ui.traceback()
61 61 raise QueryFailed('inotify query failed')
@@ -75,7 +75,7 b' class client(object):'
75 75 try:
76 76 self.sock.connect(sockpath)
77 77 except socket.error, err:
78 if err[0] == "AF_UNIX path too long":
78 if err.args[0] == "AF_UNIX path too long":
79 79 sockpath = os.readlink(sockpath)
80 80 self.sock.connect(sockpath)
81 81 else:
@@ -117,7 +117,7 b' class pollable(object):'
117 117 try:
118 118 events = cls.poll.poll(timeout)
119 119 except select.error, err:
120 if err[0] == errno.EINTR:
120 if err.args[0] == errno.EINTR:
121 121 continue
122 122 raise
123 123 if events:
@@ -336,10 +336,10 b' class socketlistener(object):'
336 336 try:
337 337 self.sock.bind(self.sockpath)
338 338 except socket.error, err:
339 if err[0] == errno.EADDRINUSE:
339 if err.args[0] == errno.EADDRINUSE:
340 340 raise AlreadyStartedException(_('cannot start: socket is '
341 341 'already bound'))
342 if err[0] == "AF_UNIX path too long":
342 if err.args[0] == "AF_UNIX path too long":
343 343 if os.path.islink(self.sockpath) and \
344 344 not os.path.exists(self.sockpath):
345 345 raise util.Abort('inotify-server: cannot start: '
@@ -437,7 +437,7 b' class socketlistener(object):'
437 437 finally:
438 438 sock.shutdown(socket.SHUT_WR)
439 439 except socket.error, err:
440 if err[0] != errno.EPIPE:
440 if err.args[0] != errno.EPIPE:
441 441 raise
442 442
443 443 if sys.platform == 'linux2':
@@ -249,9 +249,9 b' class httprepository(repo.repository):'
249 249 self.ui.status(_('remote: '), l)
250 250 return ret
251 251 except socket.error, err:
252 if err[0] in (errno.ECONNRESET, errno.EPIPE):
253 raise util.Abort(_('push failed: %s') % err[1])
254 raise util.Abort(err[1])
252 if err.args[0] in (errno.ECONNRESET, errno.EPIPE):
253 raise util.Abort(_('push failed: %s') % err.args[1])
254 raise util.Abort(err.args[1])
255 255 finally:
256 256 fp.close()
257 257 os.unlink(tempname)
General Comments 0
You need to be logged in to leave comments. Login now