summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Greco <cristian@regolo.cc>2011-11-20 15:27:17 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2011-11-20 18:00:18 +0000
commitd8560f5c259c98c4f28f0ec364bcfd76fd81183e (patch)
treef2ad62220b3908cc4f03335616698ba377895437
parent51802f7c54145cd7113e98c0043abc5cd65cf6eb (diff)
downloaddeluge-d8560f5c259c98c4f28f0ec364bcfd76fd81183e.zip
deluge-d8560f5c259c98c4f28f0ec364bcfd76fd81183e.tar.gz
deluge-d8560f5c259c98c4f28f0ec364bcfd76fd81183e.tar.bz2
Fix #1944 : Use errno constants for portability
-rw-r--r--deluge/core/torrentmanager.py3
-rw-r--r--deluge/ui/gtkui/connectionmanager.py9
2 files changed, 7 insertions, 5 deletions
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index ff6ba4f..c49e8c9 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -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)
diff --git a/deluge/ui/gtkui/connectionmanager.py b/deluge/ui/gtkui/connectionmanager.py
index dc2f742..f08af6e 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
@@ -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 \