diff options
author | toonn <toonn@toonn.io> | 2019-07-18 16:26:18 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2019-07-18 16:26:18 +0200 |
commit | 2c33cedaaac2a21d538f20fcb6fc36e23467a79d (patch) | |
tree | ab1d18488dd407c7fbcfa6ea748c0b759fadfbd3 | |
parent | 669100aad83e3a51f140b6085d836a8260eda8d0 (diff) | |
download | ranger-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.py | 4 |
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: |