diff options
author | Guido Günther <agx@sigxcpu.org> | 2015-06-12 08:52:03 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-06-12 08:52:03 +0200 |
commit | 901581b87498cdd8e965608b558a875fb13f8e09 (patch) | |
tree | 0f824879ebfb6cc812f3bc015ec8243428d680c5 /gbp/command_wrappers.py | |
parent | 6a5675cba7ca41aa0e56df245a1d56f66115bd27 (diff) |
doctest: Use C locale when parsing command output
Otherwise we fail when run in a non C locale
Diffstat (limited to 'gbp/command_wrappers.py')
-rw-r--r-- | gbp/command_wrappers.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gbp/command_wrappers.py b/gbp/command_wrappers.py index d7eb8004..ce583cd1 100644 --- a/gbp/command_wrappers.py +++ b/gbp/command_wrappers.py @@ -169,12 +169,14 @@ class Command(object): Traceback (most recent call last): ... CommandExecFailed: execution failed: ... - >>> c = Command("/bin/true", capture_stdout=True) + >>> c = Command("/bin/true", capture_stdout=True, + ... extra_env={'LC_ALL': 'C'}) >>> c.call(["--version"]) 0 >>> c.stdout.decode('utf-8').startswith('true') True - >>> c = Command("/bin/false", capture_stdout=True) + >>> c = Command("/bin/false", capture_stdout=True, + ... extra_env={'LC_ALL': 'C'}) >>> c.call(["--help"]) 1 >>> c.stdout.decode('utf-8').startswith('Usage:') |