提交 750ad907 编写于 作者: W wuzewu

Fix crash caused by non-existent configuration file

上级 c2fc2904
...@@ -32,6 +32,11 @@ class HubConfig: ...@@ -32,6 +32,11 @@ class HubConfig:
def __init__(self): def __init__(self):
self._initialize() self._initialize()
self.file = os.path.join(hubenv.CONF_HOME, 'config.yaml') self.file = os.path.join(hubenv.CONF_HOME, 'config.yaml')
if not os.path.exists(self.file):
self.flush()
return
with open(self.file, 'r') as file: with open(self.file, 'r') as file:
try: try:
cfg = yaml.load(file, Loader=yaml.FullLoader) cfg = yaml.load(file, Loader=yaml.FullLoader)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册