Skip to content

Commit eefb70e

Browse files
committed
subprocess_lib/01_run: change the order for exit_code_non_zero
1 parent 277ddc2 commit eefb70e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

subprocess_lib/01_run.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ def run_example():
1111
print(result.stderr)
1212

1313

14-
def exit_code_non_zero():
15-
# If check is True and the exit code was non-zero, it raises a CalledProcessError
16-
run(["false"], check=True)
17-
18-
1914
def capture_err_and_out():
2015
# Capture standard error and standard output in the result
2116
result = run(["ls", "-l"], stderr=PIPE, stdout=PIPE)
@@ -30,6 +25,11 @@ def capture_err_and_out_2():
3025
print(result.stdout)
3126

3227

28+
def exit_code_non_zero():
29+
# If check is True and the exit code was non-zero, it raises a CalledProcessError
30+
run(["false"], check=True)
31+
32+
3333
def timeout():
3434
# Using timeout
3535
result = run(["sleep", "1"], timeout=2)
@@ -45,8 +45,8 @@ def shell():
4545

4646
if __name__ == '__main__':
4747
run_example()
48-
# exit_code_non_zero()
4948
# capture_err_and_out()
5049
# capture_err_and_out_2()
50+
# exit_code_non_zero()
5151
# timeout()
5252
# shell()

0 commit comments

Comments
 (0)