diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2014-04-28 15:34:14 -0700 |
---|---|---|
committer | Thomas A Caswell <tcaswell@gmail.com> | 2015-09-29 15:10:33 -0400 |
commit | 06166e54cea2302bf9213f18881495eb2b5d089d (patch) | |
tree | 3185ab3f0e7c27a905ba81b283cd71ee44a53fc6 /tests | |
parent | 8d6456344b80fa5f8f745fc92e364ee8b6a75cbf (diff) | |
download | gobject-introspection-06166e54cea2302bf9213f18881495eb2b5d089d.tar.gz |
giscanner: Use print as a function for Python 3 compatibility
Use future import "print_function" and update relevant uses of print
as a function call. See: PEP 3105
https://bugzilla.gnome.org/show_bug.cgi?id=679438
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/offsets/gen-gitestoffsets | 6 | ||||
-rw-r--r-- | tests/scanner/annotationparser/test_parser.py | 1 | ||||
-rw-r--r-- | tests/scanner/annotationparser/test_patterns.py | 1 | ||||
-rw-r--r-- | tests/scanner/test_sourcescanner.py | 1 | ||||
-rw-r--r-- | tests/scanner/test_transformer.py | 1 | ||||
-rw-r--r-- | tests/warn/warningtester.py | 1 |
6 files changed, 9 insertions, 2 deletions
diff --git a/tests/offsets/gen-gitestoffsets b/tests/offsets/gen-gitestoffsets index 77351060..94a2062d 100755 --- a/tests/offsets/gen-gitestoffsets +++ b/tests/offsets/gen-gitestoffsets @@ -19,6 +19,8 @@ # 02110-1301, USA. # +from __future__ import print_function + # The idea here is that we want to compare offset information two ways: # # 1) As generated by the compiler @@ -34,7 +36,7 @@ import re import sys if len(sys.argv) != 2: - print >>sys.stderr, "Usage: gen-gitestoffsets INPUT > OUTPUT" + print("Usage: gen-gitestoffsets INPUT > OUTPUT", file=sys.stderr) sys.exit(1) # Helper function that we use to generate source. It does substitions @@ -86,7 +88,7 @@ for m in STRUCT_DEF_RE.finditer(input): continue n = FIELD_RE.match(line) if not n: - print sys.stderr, "Can't parse structure line '%s'" % line + print("Can't parse structure line '%s'" % line, file=sys.stderr) sys.exit(1) fields.append(n.group(1)) diff --git a/tests/scanner/annotationparser/test_parser.py b/tests/scanner/annotationparser/test_parser.py index 17eb12b3..2cec9f11 100644 --- a/tests/scanner/annotationparser/test_parser.py +++ b/tests/scanner/annotationparser/test_parser.py @@ -27,6 +27,7 @@ Tests ensuring annotationparser.py continues to function correctly. from __future__ import absolute_import from __future__ import division +from __future__ import print_function import difflib import os diff --git a/tests/scanner/annotationparser/test_patterns.py b/tests/scanner/annotationparser/test_patterns.py index 1648a08b..7d430940 100644 --- a/tests/scanner/annotationparser/test_patterns.py +++ b/tests/scanner/annotationparser/test_patterns.py @@ -31,6 +31,7 @@ against the expected output. from __future__ import absolute_import from __future__ import division +from __future__ import print_function from giscanner.annotationparser import (COMMENT_BLOCK_START_RE, COMMENT_BLOCK_END_RE, COMMENT_ASTERISK_RE, INDENTATION_RE, EMPTY_LINE_RE, diff --git a/tests/scanner/test_sourcescanner.py b/tests/scanner/test_sourcescanner.py index 0f1e4837..a47485e2 100644 --- a/tests/scanner/test_sourcescanner.py +++ b/tests/scanner/test_sourcescanner.py @@ -1,5 +1,6 @@ from __future__ import absolute_import from __future__ import division +from __future__ import print_function import unittest import tempfile diff --git a/tests/scanner/test_transformer.py b/tests/scanner/test_transformer.py index cf315809..1e75d688 100644 --- a/tests/scanner/test_transformer.py +++ b/tests/scanner/test_transformer.py @@ -1,5 +1,6 @@ from __future__ import absolute_import from __future__ import division +from __future__ import print_function import unittest import tempfile diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py index 600260d2..e3d677a8 100644 --- a/tests/warn/warningtester.py +++ b/tests/warn/warningtester.py @@ -1,5 +1,6 @@ from __future__ import absolute_import from __future__ import division +from __future__ import print_function import __builtin__ import os |