diff options
author | Adam Johnson <me@adamj.eu> | 2021-09-25 09:18:25 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-27 08:20:24 +0200 |
commit | 840ad06300ac38e0e0e18ea36d6969cc03c875a9 (patch) | |
tree | a06fa901030b76f1ae30446b1db37387d80653ad /scripts | |
parent | ca583783900d98188c488add21f77702a94a7922 (diff) | |
download | django-840ad06300ac38e0e0e18ea36d6969cc03c875a9.tar.gz |
Refs #32355 -- Modernized subprocess.run() calls.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/manage_translations.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/manage_translations.py b/scripts/manage_translations.py index e67bf6e74d..fd394e10ab 100644 --- a/scripts/manage_translations.py +++ b/scripts/manage_translations.py @@ -20,7 +20,7 @@ import os from argparse import ArgumentParser -from subprocess import PIPE, run +from subprocess import run import django from django.conf import settings @@ -74,7 +74,7 @@ def _check_diff(cat_name, base_path): po_path = '%(path)s/en/LC_MESSAGES/django%(ext)s.po' % { 'path': base_path, 'ext': 'js' if cat_name.endswith('-js') else ''} p = run("git diff -U0 %s | egrep '^[-+]msgid' | wc -l" % po_path, - stdout=PIPE, stderr=PIPE, shell=True) + capture_output=True, shell=True) num_changes = int(p.stdout.strip()) print("%d changed/added messages in '%s' catalog." % (num_changes, cat_name)) @@ -123,7 +123,7 @@ def lang_stats(resources=None, languages=None): ) p = run( ['msgfmt', '-vc', '-o', '/dev/null', po_path], - stdout=PIPE, stderr=PIPE, + capture_output=True, env={'LANG': 'C'}, encoding='utf-8', ) |