diff options
author | Cristian Greco <cristian@regolo.cc> | 2011-11-20 15:27:17 +0000 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2011-11-29 18:54:06 +0000 |
commit | b2eb5aeb8cda1054e84d556756604939a687126c (patch) | |
tree | 9fbc26b6711876fbfa3b4d76979cfa6da6537aa7 | |
parent | 3dcfa5cfd8a52f1dfaae62a78e0c41cbee6558db (diff) | |
download | deluge-b2eb5aeb8cda1054e84d556756604939a687126c.tar.gz deluge-b2eb5aeb8cda1054e84d556756604939a687126c.tar.bz2 deluge-b2eb5aeb8cda1054e84d556756604939a687126c.zip |
Fix #1944 : Use errno constants for portability
-rw-r--r-- | deluge/core/torrentmanager.py | 3 | ||||
-rw-r--r-- | deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py | 3 | ||||
-rw-r--r-- | deluge/ui/gtkui/connectionmanager.py | 9 |
3 files changed, 9 insertions, 6 deletions
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 10f8e231c..a4a5db85e 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -848,7 +848,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 as (errno, strerror): - if errno == 39: + from errno import ENOTEMPTY + if errno == ENOTEMPTY: # Error raised if folder is not empty log.debug("%s", strerror) diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py index a8405b422..c91eb463d 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py @@ -268,7 +268,8 @@ class Core(CorePluginBase): try: os.rename(filepath, copy_torrent_file) except OSError, why: - if why.errno == 18: + from errno import EXDEV + if why.errno == errno.EXDEV: # This can happen for different mount points from shutil import copyfile try: diff --git a/deluge/ui/gtkui/connectionmanager.py b/deluge/ui/gtkui/connectionmanager.py index a8839764a..ea8877599 100644 --- a/deluge/ui/gtkui/connectionmanager.py +++ b/deluge/ui/gtkui/connectionmanager.py @@ -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 @@ -475,7 +475,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 " |