File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,10 @@ def _load_compilers():
198
198
log .error (str (e ))
199
199
return
200
200
201
+ # Ignore empty configuration files.
202
+ if "compiler" not in toml :
203
+ return
204
+
201
205
for name , definition in toml ["compiler" ].items ():
202
206
# Check if the user is defining a new compiler.
203
207
if name not in _compilers :
Original file line number Diff line number Diff line change @@ -422,6 +422,16 @@ def test_unrecognized(self):
422
422
423
423
tmp .cleanup ()
424
424
425
+ def test_empty_config (self ):
426
+ """Check that we ignore empty configuration files."""
427
+ tmp = tempfile .TemporaryDirectory ()
428
+ path = Path (tmp .name )
429
+ os .chdir (tmp .name )
430
+ os .mkdir (".cbi" )
431
+ open (path / ".cbi" / "config" , mode = "w" ).close ()
432
+ config ._load_compilers ()
433
+ tmp .cleanup ()
434
+
425
435
426
436
if __name__ == "__main__" :
427
437
unittest .main ()
You can’t perform that action at this time.
0 commit comments