about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2019-07-18 16:26:18 +0200
committertoonn <toonn@toonn.io>2019-07-18 16:26:18 +0200
commit2c33cedaaac2a21d538f20fcb6fc36e23467a79d (patch)
treeab1d18488dd407c7fbcfa6ea748c0b759fadfbd3
parent669100aad83e3a51f140b6085d836a8260eda8d0 (diff)
downloadranger-2c33cedaaac2a21d538f20fcb6fc36e23467a79d.tar.gz
Catch exceptions when resolving macros in rc.conf
While parsing the settings in `rc.conf` `self.fm.thisfile` doesn't exist
yet.
-rw-r--r--ranger/core/actions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 435fcf13..00394be5 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -303,9 +303,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
             macros['datadir'] = self.fm.datapath()
         macros['space'] = ' '
 
-        if self.fm.thisfile:
+        try:
             macros['f'] = self.fm.thisfile.relative_path
-        else:
+        except AttributeError:
             macros['f'] = MACRO_FAIL
 
         if self.fm.thistab.get_selection: