fix windows bugs (#30)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
# Modified from mmcv
|
||||
# ==========================================================
|
||||
import ast
|
||||
import os
|
||||
import os.path as osp
|
||||
import shutil
|
||||
import sys
|
||||
@@ -80,6 +81,8 @@ class SLConfig(object):
|
||||
with tempfile.TemporaryDirectory() as temp_config_dir:
|
||||
temp_config_file = tempfile.NamedTemporaryFile(dir=temp_config_dir, suffix=".py")
|
||||
temp_config_name = osp.basename(temp_config_file.name)
|
||||
if os.name == 'nt':
|
||||
temp_config_file.close()
|
||||
shutil.copyfile(filename, osp.join(temp_config_dir, temp_config_name))
|
||||
temp_module_name = osp.splitext(temp_config_name)[0]
|
||||
sys.path.insert(0, temp_config_dir)
|
||||
|
Reference in New Issue
Block a user