I'm using the public functions of Python's built-in compileall module.
https://docs.python.org/3/library/compileall.html#public-functions
There doesn't appear to be documentation of what each of these functions returns.
I figured out, for example, that compileall.compile_file() returns 1 when the file compiles successfully, and 0 if not.
If this is "official" behavior, it would be good to see it documented so that we can rely on it.
I'd be happy to submit a patch to fix this if a committer is willing to shepherd a new contributor (me) through the process. Otherwise, this is probably a quick fix for experienced contributors.