浏览代码

Fix typo of saving default_config_file

Kentaro Wada 7 年之前
父节点
当前提交
721d3547c4
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      labelme/config/__init__.py

+ 3 - 2
labelme/config/__init__.py

@@ -54,10 +54,11 @@ def get_config(config_from_args=None, config_file=None):
     default_config_file = osp.join(home, '.labelmerc')
     default_config_file = osp.join(home, '.labelmerc')
     if not osp.exists(default_config_file):
     if not osp.exists(default_config_file):
         try:
         try:
-            with open(config_file, 'w') as f:
+            with open(default_config_file, 'w') as f:
                 yaml.safe_dump(config, f, default_flow_style=False)
                 yaml.safe_dump(config, f, default_flow_style=False)
         except Exception:
         except Exception:
-            logger.warn('Failed to save config: {}'.format(config_file))
+            logger.warn('Failed to save config: {}'
+                        .format(default_config_file))
 
 
     # 2. config from yaml file
     # 2. config from yaml file
     if config_file is None:
     if config_file is None: