Fix #1944 : Use errno constants for portability
This commit is contained in:
parent
51802f7c54
commit
d8560f5c25
|
@ -790,7 +790,8 @@ class TorrentManager(component.Component):
|
|||
os.removedirs(os.path.join(root, name))
|
||||
log.debug("Removed Empty Folder %s", os.path.join(root, name))
|
||||
except OSError, (errno, strerror):
|
||||
if errno == 39:
|
||||
from errno import ENOTEMPTY
|
||||
if errno == ENOTEMPTY:
|
||||
# Error raised if folder is not empty
|
||||
log.debug("%s", strerror)
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with deluge. If not, write to:
|
||||
# The Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor
|
||||
# Boston, MA 02110-1301, USA.
|
||||
# The Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# In addition, as a special exception, the copyright holders give
|
||||
# permission to link the code of portions of this program with the OpenSSL
|
||||
|
@ -409,7 +409,8 @@ class ConnectionManager(component.Component):
|
|||
try:
|
||||
return client.start_daemon(port, config)
|
||||
except OSError, e:
|
||||
if e.errno == 2:
|
||||
from errno import ENOENT
|
||||
if e.errno == ENOENT:
|
||||
dialogs.ErrorDialog(
|
||||
_("Unable to start daemon!"),
|
||||
_("Deluge cannot find the 'deluged' executable, it is likely \
|
||||
|
|
Loading…
Reference in New Issue