m-aciek / python-docs-weblate

Python docs on Weblate POC
0 stars 0 forks source link

.update-pots.py: use check_call and check_output #9

Closed m-aciek closed 1 year ago

m-aciek commented 1 year ago

It raises exceptions for unsuccessful subprocess calls, so it's much more verbose then earlier (exit without stdout).

Example:

…

Traceback (most recent call last):
  File "/Users/maciej.olko/projects/python-docs-weblate/.update-pots.py", line 67, in <module>
    _update_pots(options.version)
  File "/Users/maciej.olko/projects/python-docs-weblate/.update-pots.py", line 14, in _update_pots
    _call('git diff --exit-code')
  File "/Users/maciej.olko/projects/python-docs-weblate/.update-pots.py", line 55, in _call
    check_call(command, shell=True)
  File "/Users/maciej.olko/.pyenv/versions/3.11-dev/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'git diff --exit-code' returned non-zero exit status 1.