Skip to content

Commit 010d797

Browse files
committed
Changing position of early exit and using standard error method with correct exit code
1 parent 69b12ff commit 010d797

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bootstrap/configure.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -523,17 +523,17 @@ def write_config_toml(writer, section_order, targets, sections):
523523

524524
def quit_if_file_exists(file):
525525
if os.path.isfile(file):
526-
p("Existing '" + file + "' detected. EXITING")
527-
quit()
526+
err("Existing '" + file + "' detected.")
528527

529528
if __name__ == "__main__":
529+
# If 'config.toml' already exists, exit the script at this point
530+
quit_if_file_exists('config.toml')
531+
530532
p("processing command line")
531533
# Parse all known arguments into a configuration structure that reflects the
532534
# TOML we're going to write out
533535
p("")
534536
section_order, sections, targets = parse_args(sys.argv[1:])
535-
# If 'config.toml' already exists, exit the script at this point
536-
quit_if_file_exists('config.toml')
537537

538538
# Now that we've built up our `config.toml`, write it all out in the same
539539
# order that we read it in.

0 commit comments

Comments
 (0)