From 81736ab9ecbb3d7f17e88699367aff728a27f487 Mon Sep 17 00:00:00 2001 From: wangzhaolin Date: Tue, 22 Oct 2019 20:20:10 +0800 Subject: [PATCH] add __file__ attribute when load .py config file --- orator/commands/command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orator/commands/command.py b/orator/commands/command.py index 2a114400..85a878b3 100644 --- a/orator/commands/command.py +++ b/orator/commands/command.py @@ -123,7 +123,7 @@ def _get_config(self, path=None): config = {} with open(path) as fh: - exec(fh.read(), {}, config) + exec(fh.read(), {"__file__": path}, config) else: raise RuntimeError("Config file [%s] is not supported." % path)