mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-19 22:58:30 +00:00
Fix #1944 : Use errno constants for portability
This commit is contained in:
parent
3dcfa5cfd8
commit
b2eb5aeb8c
@ -848,7 +848,8 @@ class TorrentManager(component.Component):
|
|||||||
os.removedirs(os.path.join(root, name))
|
os.removedirs(os.path.join(root, name))
|
||||||
log.debug("Removed Empty Folder %s", os.path.join(root, name))
|
log.debug("Removed Empty Folder %s", os.path.join(root, name))
|
||||||
except OSError as (errno, strerror):
|
except OSError as (errno, strerror):
|
||||||
if errno == 39:
|
from errno import ENOTEMPTY
|
||||||
|
if errno == ENOTEMPTY:
|
||||||
# Error raised if folder is not empty
|
# Error raised if folder is not empty
|
||||||
log.debug("%s", strerror)
|
log.debug("%s", strerror)
|
||||||
|
|
||||||
|
@ -268,7 +268,8 @@ class Core(CorePluginBase):
|
|||||||
try:
|
try:
|
||||||
os.rename(filepath, copy_torrent_file)
|
os.rename(filepath, copy_torrent_file)
|
||||||
except OSError, why:
|
except OSError, why:
|
||||||
if why.errno == 18:
|
from errno import EXDEV
|
||||||
|
if why.errno == errno.EXDEV:
|
||||||
# This can happen for different mount points
|
# This can happen for different mount points
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
try:
|
try:
|
||||||
|
@ -475,7 +475,8 @@ class ConnectionManager(component.Component):
|
|||||||
try:
|
try:
|
||||||
return client.start_daemon(port, config)
|
return client.start_daemon(port, config)
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
if e.errno == 2:
|
from errno import ENOENT
|
||||||
|
if e.errno == ENOENT:
|
||||||
dialogs.ErrorDialog(
|
dialogs.ErrorDialog(
|
||||||
_("Unable to start daemon!"),
|
_("Unable to start daemon!"),
|
||||||
_("Deluge cannot find the 'deluged' executable, it is "
|
_("Deluge cannot find the 'deluged' executable, it is "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user