From 2c33cedaaac2a21d538f20fcb6fc36e23467a79d Mon Sep 17 00:00:00 2001 From: toonn Date: Thu, 18 Jul 2019 16:26:18 +0200 Subject: Catch exceptions when resolving macros in rc.conf While parsing the settings in `rc.conf` `self.fm.thisfile` doesn't exist yet. --- ranger/core/actions.py | 4 ++-- 1 file 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: -- cgit 1.4.1-2-gfad0