a better check for opts

This commit is contained in:
Piotr Migdal
2022-03-27 21:13:33 +02:00
committed by Serene-Arc
parent 0731de788d
commit 5f443fddff

View File

@@ -53,7 +53,7 @@ class Configuration(Namespace):
self.comment_context: bool = False self.comment_context: bool = False
def process_click_arguments(self, context: click.Context): def process_click_arguments(self, context: click.Context):
if context.params['opts'] is not None: if context.params.get('opts') is not None:
with open(context.params['opts']) as f: with open(context.params['opts']) as f:
opts = yaml.load(f, Loader=yaml.FullLoader) opts = yaml.load(f, Loader=yaml.FullLoader)
for arg_key, val in opts.items(): for arg_key, val in opts.items():