inotify: on Python < 2.6, socket.error lacks errno

This commit is contained in:
Bryan O'Sullivan 2012-12-20 11:40:04 -08:00
parent fa2bc9d633
commit bac2c7da41

View File

@ -334,7 +334,7 @@ class socketlistener(object):
lambda p: os.path.join(root, '.hg', p),
'inotify')
except (OSError, socket.error), err:
if err.errno == errno.EADDRINUSE:
if err.args[0] == errno.EADDRINUSE:
raise AlreadyStartedException(_('cannot start: '
'socket is already bound'))
raise