Skip to content

Commit 46c2888

Browse files
committed
Revert "Removed unnecessary indentation blocks and updated conditional statements."
This reverts commit 4a6dd9a.
1 parent 30d9910 commit 46c2888

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

release.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def system(command):
1111
print(command)
1212
exit_code = os.system(command)
13-
if exit_code:
13+
if exit_code != 0:
1414
sys.exit(exit_code)
1515

1616

@@ -21,7 +21,7 @@ def check_git():
2121

2222
system("git fetch origin")
2323
behind = int(subprocess.check_output(["git", "rev-list", "--count", "master..origin/master"]))
24-
if behind:
24+
if behind > 0:
2525
print(f"master is {behind} commit(s) behind origin/master")
2626
sys.exit(1)
2727

@@ -65,14 +65,15 @@ def tag_and_push():
6565
release_txt.write(headline + os.linesep)
6666

6767
for line in changelog_file:
68-
if line.startswith("-------") and not first_section:
69-
first_section = True
68+
if not first_section:
69+
if line.startswith("-------"):
70+
first_section = True
7071
else:
7172
if line.startswith("-------"):
7273
break
73-
74-
if not prev_line.startswith("------"):
75-
release_txt.write(prev_line)
74+
else:
75+
if not prev_line.startswith("------"):
76+
release_txt.write(prev_line)
7677

7778
prev_line = line
7879

0 commit comments

Comments
 (0)