From b86e3c3c4e3a029834176eaa5ae2eefb769ced1b Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 17 Sep 2011 15:02:44 +0200 Subject: use errno.EEXIST ... instead of its raw value (on Linux, for example) --- ranger/core/helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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") -- cgit 1.4.1-2-gfad0