File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -311,8 +311,6 @@ def _parse_args(self) -> Namespace:
311311 # (see https://bugs.python.org/issue16399)
312312 # Allow no-config for certain commands (like downloading / plotting)
313313 if "config" in parsed_arg and parsed_arg .config is None :
314- conf_required = "command" in parsed_arg and parsed_arg .command in NO_CONF_REQURIED
315-
316314 if "user_data_dir" in parsed_arg and parsed_arg .user_data_dir is not None :
317315 user_dir = parsed_arg .user_data_dir
318316 else :
@@ -325,7 +323,9 @@ def _parse_args(self) -> Namespace:
325323 else :
326324 # Else use "config.json".
327325 cfgfile = Path .cwd () / DEFAULT_CONFIG
328- if cfgfile .is_file () or not conf_required :
326+ conf_optional = "command" in parsed_arg and parsed_arg .command in NO_CONF_REQURIED
327+ if cfgfile .is_file () or not conf_optional :
328+ # Only inject config if the file exists, or if the config is optional
329329 parsed_arg .config = [DEFAULT_CONFIG ]
330330
331331 return parsed_arg
You can’t perform that action at this time.
0 commit comments