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