about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2016-02-24 22:42:40 +0100
committerhut <hut@lepus.uberspace.de>2016-02-24 22:42:53 +0100
commit2132b95f9fc889276abf0f5e22f7e876bc6ca8ab (patch)
treecbcadf583aaacac941efb08e25106c6d62fa33a8
parent24d5eb069dbe77e7755acf0a9ab8c8c153616642 (diff)
downloadranger-2132b95f9fc889276abf0f5e22f7e876bc6ca8ab.tar.gz
python2 compatibility for previous commit
-rw-r--r--ranger/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index 6d16cc5e..b562ebf5 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -30,9 +30,14 @@ USAGE = '%prog [options] [path]'
 VERSION = 'ranger-master %s\n\nPython %s' % (__version__, sys.version)
 
 try:
+    ExceptionClass = FileNotFoundError
+except NameError:
+    ExceptionClass = IOError
+try:
     LOGFILE = tempfile.gettempdir()+'/ranger_errorlog'
-except FileNotFoundError:
+except ExceptionClass:
     LOGFILE = '/dev/null'
+del ExceptionClass
 
 # If the environment variable XDG_CONFIG_HOME is non-empty, CONFDIR is ignored
 # and the configuration directory will be $XDG_CONFIG_HOME/ranger instead.