未验证 提交 947395bb 编写于 作者: W wuzhihua 提交者: GitHub

Merge pull request #102 from gentelyang/master

fix win py3
......@@ -19,6 +19,7 @@ import os
import socket
import sys
import traceback
import six
global_envs = {}
global_envs_flatten = {}
......@@ -253,11 +254,19 @@ def load_yaml(config):
use_full_loader = False
if os.path.isfile(config):
with open(config, 'r') as rb:
if use_full_loader:
_config = yaml.load(rb.read(), Loader=yaml.FullLoader)
else:
_config = yaml.load(rb.read())
return _config
if six.PY2:
with open(config, 'r') as rb:
if use_full_loader:
_config = yaml.load(rb.read(), Loader=yaml.FullLoader)
else:
_config = yaml.load(rb.read())
return _config
else:
with open(config, 'r', encoding="utf-8") as rb:
if use_full_loader:
_config = yaml.load(rb.read(), Loader=yaml.FullLoader)
else:
_config = yaml.load(rb.read())
return _config
else:
raise ValueError("config {} can not be supported".format(config))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册