diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2014-04-28 14:55:27 -0700 |
---|---|---|
committer | Thomas A Caswell <tcaswell@gmail.com> | 2015-09-29 14:59:40 -0400 |
commit | 2cfccfb860bbc8c5be77792012172bceb7e8b9e2 (patch) | |
tree | a0a28495cfae5aa86aedf6e28cf17290a16b8e6d | |
parent | e09c0a2bca45016daee064669ef5b1c9a748a566 (diff) | |
download | gobject-introspection-2cfccfb860bbc8c5be77792012172bceb7e8b9e2.tar.gz |
giscanner: Use absolute_import for all Python files
Use absolute_import to ensure Python 3 compatibility of the code base.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
32 files changed, 53 insertions, 3 deletions
diff --git a/giscanner/__init__.py b/giscanner/__init__.py index 5ab7a957..139b5187 100644 --- a/giscanner/__init__.py +++ b/giscanner/__init__.py @@ -17,7 +17,7 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # - +from __future__ import absolute_import import os builddir = os.environ.get('UNINSTALLED_INTROSPECTION_BUILDDIR') if builddir is not None: diff --git a/giscanner/annotationmain.py b/giscanner/annotationmain.py index 618cf47f..42e3c76d 100644 --- a/giscanner/annotationmain.py +++ b/giscanner/annotationmain.py @@ -18,6 +18,8 @@ # 02110-1301, USA. # +from __future__ import absolute_import + import optparse from giscanner import message diff --git a/giscanner/ast.py b/giscanner/ast.py index 9f1e4cc0..a3f422c0 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -19,6 +19,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + import copy from itertools import chain diff --git a/giscanner/cachestore.py b/giscanner/cachestore.py index bc5443d5..abab276b 100644 --- a/giscanner/cachestore.py +++ b/giscanner/cachestore.py @@ -18,6 +18,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + import errno import cPickle import glob diff --git a/giscanner/codegen.py b/giscanner/codegen.py index 20e087b4..1e6bcb2f 100644 --- a/giscanner/codegen.py +++ b/giscanner/codegen.py @@ -19,6 +19,7 @@ # from __future__ import with_statement +from __future__ import absolute_import from contextlib import contextmanager diff --git a/giscanner/collections/__init__.py b/giscanner/collections/__init__.py index aa3814a7..05fdf072 100644 --- a/giscanner/collections/__init__.py +++ b/giscanner/collections/__init__.py @@ -18,6 +18,7 @@ # 02110-1301, USA. # +from __future__ import absolute_import from .counter import Counter from .ordereddict import OrderedDict diff --git a/giscanner/docmain.py b/giscanner/docmain.py index b5baf99e..de1958b8 100644 --- a/giscanner/docmain.py +++ b/giscanner/docmain.py @@ -18,6 +18,8 @@ # 02110-1301, USA. # +from __future__ import absolute_import + import os import argparse diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py index 8052a424..09915c4f 100644 --- a/giscanner/docwriter.py +++ b/giscanner/docwriter.py @@ -21,6 +21,8 @@ # 02110-1301, USA. # +from __future__ import absolute_import + import os import re import tempfile diff --git a/giscanner/dumper.py b/giscanner/dumper.py index 18725c8a..e8d4d26e 100644 --- a/giscanner/dumper.py +++ b/giscanner/dumper.py @@ -19,6 +19,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + import os import sys import subprocess diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py index 405ce28c..da3e721c 100644 --- a/giscanner/gdumpparser.py +++ b/giscanner/gdumpparser.py @@ -18,6 +18,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + import os import sys import tempfile diff --git a/giscanner/girparser.py b/giscanner/girparser.py index 248e223a..e8dd991d 100644 --- a/giscanner/girparser.py +++ b/giscanner/girparser.py @@ -18,6 +18,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + import os from xml.etree.cElementTree import parse diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py index 1af1ba5c..8b488f45 100644 --- a/giscanner/girwriter.py +++ b/giscanner/girwriter.py @@ -20,6 +20,7 @@ # from __future__ import with_statement +from __future__ import absolute_import from . import ast from .xmlwriter import XMLWriter diff --git a/giscanner/introspectablepass.py b/giscanner/introspectablepass.py index ac68b9f7..6a8547d0 100644 --- a/giscanner/introspectablepass.py +++ b/giscanner/introspectablepass.py @@ -16,6 +16,7 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import from . import ast from . import message diff --git a/giscanner/libtoolimporter.py b/giscanner/libtoolimporter.py index c8501035..1e7ff376 100644 --- a/giscanner/libtoolimporter.py +++ b/giscanner/libtoolimporter.py @@ -18,6 +18,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + import imp import os import sys diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index f2949822..d41a96b6 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -17,6 +17,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + import re from . import ast diff --git a/giscanner/message.py b/giscanner/message.py index a6bdfaa3..e222724d 100644 --- a/giscanner/message.py +++ b/giscanner/message.py @@ -20,6 +20,8 @@ # 02110-1301, USA. # +from __future__ import absolute_import + import os import sys diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py index 89ec1937..b04bb109 100755 --- a/giscanner/scannermain.py +++ b/giscanner/scannermain.py @@ -20,6 +20,8 @@ # 02110-1301, USA. # +from __future__ import absolute_import + import errno import optparse import os diff --git a/giscanner/sectionparser.py b/giscanner/sectionparser.py index ed4660fe..528e5c84 100644 --- a/giscanner/sectionparser.py +++ b/giscanner/sectionparser.py @@ -17,6 +17,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + import re from . import ast from .utils import to_underscores diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py index cd0c10f1..424cad05 100644 --- a/giscanner/shlibs.py +++ b/giscanner/shlibs.py @@ -19,6 +19,8 @@ # 02110-1301, USA. # +from __future__ import absolute_import + import os import platform import re diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py index e66ed7de..15a9c983 100644 --- a/giscanner/sourcescanner.py +++ b/giscanner/sourcescanner.py @@ -19,6 +19,8 @@ # from __future__ import with_statement +from __future__ import absolute_import + import os import subprocess import tempfile diff --git a/giscanner/testcodegen.py b/giscanner/testcodegen.py index 5080ed1b..ef123517 100644 --- a/giscanner/testcodegen.py +++ b/giscanner/testcodegen.py @@ -18,6 +18,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + from StringIO import StringIO from . import ast from .codegen import CCodeGenerator diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 133edd4b..c5b0a2eb 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -18,6 +18,8 @@ # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import + import os import sys import subprocess diff --git a/giscanner/utils.py b/giscanner/utils.py index e9ae0b6a..bac402d5 100644 --- a/giscanner/utils.py +++ b/giscanner/utils.py @@ -17,6 +17,7 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # +from __future__ import absolute_import import errno import re diff --git a/giscanner/xmlwriter.py b/giscanner/xmlwriter.py index 5fdcffed..c1cca858 100755 --- a/giscanner/xmlwriter.py +++ b/giscanner/xmlwriter.py @@ -19,6 +19,7 @@ # from __future__ import with_statement +from __future__ import absolute_import import os diff --git a/misc/update-glib-annotations.py b/misc/update-glib-annotations.py index ba1e24dc..71670a36 100755 --- a/misc/update-glib-annotations.py +++ b/misc/update-glib-annotations.py @@ -3,6 +3,7 @@ # e.g.: # ./update-glib-annotations.py ../../glib ../../glib/_build +from __future__ import absolute_import import os import sys diff --git a/misc/verbump.py b/misc/verbump.py index 0c7d593f..ac2e1b35 100644 --- a/misc/verbump.py +++ b/misc/verbump.py @@ -3,6 +3,8 @@ # * Create a git tag # * Bump version in configure.ac and commit it +from __future__ import absolute_import + import re import os import sys diff --git a/tests/scanner/annotationparser/test_parser.py b/tests/scanner/annotationparser/test_parser.py index 99c5da79..01bd000e 100644 --- a/tests/scanner/annotationparser/test_parser.py +++ b/tests/scanner/annotationparser/test_parser.py @@ -25,6 +25,7 @@ test_parser.py Tests ensuring annotationparser.py continues to function correctly. ''' +from __future__ import absolute_import import difflib import os diff --git a/tests/scanner/annotationparser/test_patterns.py b/tests/scanner/annotationparser/test_patterns.py index 738a83ff..327f240d 100644 --- a/tests/scanner/annotationparser/test_patterns.py +++ b/tests/scanner/annotationparser/test_patterns.py @@ -18,7 +18,6 @@ # 02110-1301, USA. # - ''' test_patterns.py @@ -30,6 +29,7 @@ should match, resulting symbolic groups are verified against the expected output. ''' +from __future__ import absolute_import 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 3963683d..a6655540 100644 --- a/tests/scanner/test_sourcescanner.py +++ b/tests/scanner/test_sourcescanner.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import + import unittest import tempfile import os diff --git a/tests/scanner/test_transformer.py b/tests/scanner/test_transformer.py index 37dbce91..c9ca75f3 100644 --- a/tests/scanner/test_transformer.py +++ b/tests/scanner/test_transformer.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import + import unittest import tempfile import os diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py index b2117910..4138518a 100644 --- a/tests/warn/warningtester.py +++ b/tests/warn/warningtester.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import + import __builtin__ import os import sys diff --git a/tools/g-ir-tool-template.in b/tools/g-ir-tool-template.in index 43eea46e..343e89da 100644 --- a/tools/g-ir-tool-template.in +++ b/tools/g-ir-tool-template.in @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # - +from __future__ import absolute_import import os import sys import __builtin__ |