Fix building static media on Django 1.11.

Review Request #10604 — Created June 21, 2019 and submitted

Information

Djblets
release-2.0.x

Reviewers

Our wrapper script for building static media attempted to honor the
exit code of the collectstatic management command, passing it along to
sys.exit() so that we wouldn't have a failure show up as a successful
result.

However, exit codes are never returned. Instead, we were always getting
None back, which Python helpfully converts to an exit code of 0. Any
failure would have been an explicit sys.exit(1) or a raised exception.
So what we were doing was pointless.

On Django 1.11, though, we actually got a result back: The result of
stdout. We were then passing this to sys.exit(), which Python was
converting to an exit code of 1, resulting in the command always
failing.

We now just exit normally without trying to be clever and helpful,
letting Django do its own thing.

Built static media on Django 1.11 successfully.

Summary ID
Fix building static media on Django 1.11.
Our wrapper script for building static media attempted to honor the exit code of the `collectstatic` management command, passing it along to `sys.exit()` so that we wouldn't have a failure show up as a successful result. However, exit codes are never returned. Instead, we were always getting `None` back, which Python helpfully converts to an exit code of 0. Any failure would have been an explicit `sys.exit(1)` or a raised exception. So what we were doing was pointless. On Django 1.11, though, we actually got a result back: The result of `stdout`. We were then passing this to `sys.exit()`, which Python was converting to an exit code of 1, resulting in the command always failing. We now just exit normally without trying to be clever and helpful, letting Django do its own thing.
7a300df21af1ed064ec1a9b3e4bd0f2b3e8638c4
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (72902a9)