Protect get_file_to_edit from not having a load_only

This commit is contained in:
Pradyun S. Gedam 2017-06-13 21:40:35 +05:30
parent 0802d3f082
commit daf754ae25
1 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,9 @@ class Configuration(object):
def get_file_to_edit(self):
"""Returns the file with highest priority in configuration
"""
assert self.load_only is not None, \
"Need to be specified a file to be editing"
try:
return self._get_parser_to_modify()[0]
except IndexError: