From e1bba5d977a8b9385e9ffdb05861833485003d23 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Wed, 27 Jan 2016 10:44:41 +0100 Subject: Make tests scripts Python 3 compatible --- test/CheckOptions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/CheckOptions.py') diff --git a/test/CheckOptions.py b/test/CheckOptions.py index e4a1fdc3..dc865532 100755 --- a/test/CheckOptions.py +++ b/test/CheckOptions.py @@ -36,6 +36,7 @@ class CheckOptions (object): def find_functions(self, filename): return self.find_pattern(filename, self.function_pattern) + def find_alternates(self): command = shlex.split('grep --no-filename OPT_ALT') for source_file in ['session', 'report']: @@ -53,7 +54,7 @@ class CheckOptions (object): pipe = Popen('%s --debug option.names parse true' % self.ledger, shell=True, stdout=PIPE, stderr=PIPE) regex = re.compile('\[DEBUG\]\s+Option:\s+(.*?)_?$') - ledger_options = {match.group(1).replace('_', '-') for match in {regex.search(line.decode()) for line in pipe.stderr} if match} + ledger_options = {match.group(1).replace('_', '-') for match in {regex.search(line.decode()) for line in pipe.stderr.readlines()} if match} return ledger_options def ledger_functions(self): -- cgit v1.2.3