yym68686 commited on
Commit
077bdaa
·
1 Parent(s): 810662a

Support downloading configuration files from external URLs.

Browse files
Files changed (1) hide show
  1. utils.py +4 -2
utils.py CHANGED
@@ -25,8 +25,10 @@ def update_config(config_data):
25
  def load_config():
26
  try:
27
  with open('./api.yaml', 'r') as f:
28
- conf = yaml.safe_load(f)
29
- return update_config(conf)
 
 
30
  except FileNotFoundError:
31
  logger.error("配置文件 'api.yaml' 未找到。请确保文件存在于正确的位置。")
32
  return [], [], []
 
25
  def load_config():
26
  try:
27
  with open('./api.yaml', 'r') as f:
28
+ # 判断是否为空文件
29
+ if f.readable():
30
+ conf = yaml.safe_load(f)
31
+ return update_config(conf)
32
  except FileNotFoundError:
33
  logger.error("配置文件 'api.yaml' 未找到。请确保文件存在于正确的位置。")
34
  return [], [], []