diff --git a/hancho.py b/hancho.py index c888b74..77f3425 100755 --- a/hancho.py +++ b/hancho.py @@ -463,12 +463,16 @@ def __init__(self, **kwargs): super().__init__(self) self.base = None self |= kwargs + if config is not None and self.rule_dir is None: + self.rule_dir = relpath( + Path(inspect.stack(context=0)[1].filename).parent, self.root_dir + ) def __missing__(self, key): if self.base: # Why does this trigger pylint? return self.base[key] # pylint: disable=unsubscriptable-object - if id(self) != id(config): + if config is not None and id(self) != id(config): return config[key] return None @@ -566,7 +570,6 @@ async def run_async(self): if self.debug: log("") - ######################################## async def task_main(self):