summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPino Toscano <toscano.pino@tiscali.it>2011-09-17 15:02:44 +0200
committerhut <hut@lavabit.com>2011-09-17 21:46:25 +0200
commitb86e3c3c4e3a029834176eaa5ae2eefb769ced1b (patch)
treefb3682c2507a7407a1cfe10aa0470319486379d8
parent98761094d8e9f43fae4342e44c2bcdc6dea59331 (diff)
downloadranger-b86e3c3c4e3a029834176eaa5ae2eefb769ced1b.tar.gz
use errno.EEXIST
... instead of its raw value (on Linux, for example)
-rw-r--r--ranger/core/helper.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/core/helper.py b/ranger/core/helper.py
index cb0afefe..ad5541f5 100644
--- a/ranger/core/helper.py
+++ b/ranger/core/helper.py
@@ -15,6 +15,7 @@
 
 """Helper functions"""
 
+from errno import EEXIST
 import os.path
 import sys
 from ranger import *
@@ -150,7 +151,7 @@ def allow_access_to_confdir(confdir, allow):
 		try:
 			os.makedirs(confdir)
 		except OSError as err:
-			if err.errno != 17:  # 17 means it already exists
+			if err.errno != EEXIST:  # EEXIST means it already exists
 				print("This configuration directory could not be created:")
 				print(confdir)
 				print("To run ranger without the need for configuration")