[systemd-commits] test/rule-syntax-check.py

Martin Pitt martin at kemper.freedesktop.org
Tue Jan 20 03:26:44 PST 2015


 test/rule-syntax-check.py |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c6be83c16d605fb2e66b2a5a8ff0f4a7a6e0e1e4
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date:   Tue Jan 20 12:18:40 2015 +0100

    test/rule-syntax-check.py: Fix for Python 3
    
    Make this work with both Python 2 and 3.

diff --git a/test/rule-syntax-check.py b/test/rule-syntax-check.py
index ce4f5c7..8da38cd 100755
--- a/test/rule-syntax-check.py
+++ b/test/rule-syntax-check.py
@@ -21,7 +21,7 @@ import re
 import sys
 
 if len(sys.argv) < 2:
-    print >> sys.stderr, 'Usage: %s <rules file> [...]' % sys.argv[0]
+    sys.stderr.write('Usage: %s <rules file> [...]\n' % sys.argv[0])
     sys.exit(2)
 
 no_args_tests = re.compile('(ACTION|DEVPATH|KERNELS?|NAME|SYMLINK|SUBSYSTEMS?|DRIVERS?|TAG|RESULT|TEST)\s*(?:=|!)=\s*"([^"]*)"$')
@@ -55,8 +55,8 @@ for path in sys.argv[1:]:
                     no_args_assign.match(clause) or args_assign.match(clause)):
 
                 print('Invalid line %s:%i: %s' % (path, lineno, line))
-                print('  clause:', clause)
-                print()
+                print('  clause: %s' % clause)
+                print('')
                 result = 1
                 break
 



More information about the systemd-commits mailing list