File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,8 @@ def find_configs(dirs: Optional[Iterable[str]] = None) -> List[str]:
494494
495495 config = os .getenv (ENV_TORCHXCONFIG )
496496 if config is not None :
497+ if not config :
498+ return []
497499 configfile = Path (config )
498500 if not configfile .is_file ():
499501 raise FileNotFoundError (
Original file line number Diff line number Diff line change @@ -275,6 +275,12 @@ def test_get_configs(self) -> None:
275275 ),
276276 )
277277
278+ def test_no_config (self ) -> None :
279+ config_dir = self .tmpdir
280+ with patch .dict (os .environ , {ENV_TORCHXCONFIG : str ("" )}):
281+ configs = find_configs (dirs = [str (config_dir )])
282+ self .assertEqual ([], configs )
283+
278284 def test_find_configs (self ) -> None :
279285 config_dir = self .tmpdir
280286 cwd_dir = config_dir / "cwd"
You can’t perform that action at this time.
0 commit comments