From eceefe7114bc5d0fc94ac77ee4e510c94c1a76bf Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Wed, 21 Jun 2017 14:57:13 -0700 Subject: add Python3 support with six switch to relative imports for package file use absolute imports in main this requires renaming anteater.py to main.py to avoid absolute import name conflict update setup.py to indicate python 3.4 support Change-Id: I0fcaf8a9825557962dc98a6a4eef490051fbbfb0 Signed-off-by: Ross Brattain --- anteater/src/__init__.py | 1 + anteater/src/get_lists.py | 6 ++++-- anteater/src/patch_scan.py | 6 +++--- anteater/src/project_scan.py | 7 ++++--- 4 files changed, 12 insertions(+), 8 deletions(-) (limited to 'anteater/src') diff --git a/anteater/src/__init__.py b/anteater/src/__init__.py index 896994c..1db8868 100644 --- a/anteater/src/__init__.py +++ b/anteater/src/__init__.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import import pkg_resources try: diff --git a/anteater/src/get_lists.py b/anteater/src/get_lists.py index b7b9aea..e27335a 100644 --- a/anteater/src/get_lists.py +++ b/anteater/src/get_lists.py @@ -13,15 +13,17 @@ Gathers various values from the gate check yaml file and return them to the calling instance """ +from __future__ import absolute_import import anteater.utils.anteater_logger as antlog -import ConfigParser +import six.moves.configparser import copy import os import yaml import re -config = ConfigParser.RawConfigParser() + +config = six.moves.configparser.RawConfigParser() config.read('anteater.conf') logger = antlog.Logger(__name__).getLogger() master_list = config.get('config', 'master_list') diff --git a/anteater/src/patch_scan.py b/anteater/src/patch_scan.py index f8ef225..71604a8 100644 --- a/anteater/src/patch_scan.py +++ b/anteater/src/patch_scan.py @@ -19,15 +19,15 @@ from __future__ import division, print_function, absolute_import from binaryornot.check import is_binary import anteater.utils.anteater_logger as antlog -import anteater.src.get_lists as get_lists -import ConfigParser import hashlib +import six.moves.configparser import sys import re +from . import get_lists logger = antlog.Logger(__name__).getLogger() -config = ConfigParser.RawConfigParser() +config = six.moves.configparser.RawConfigParser() config.read('anteater.conf') reports_dir = config.get('config', 'reports_dir') failure = False diff --git a/anteater/src/project_scan.py b/anteater/src/project_scan.py index 15498f1..647c256 100644 --- a/anteater/src/project_scan.py +++ b/anteater/src/project_scan.py @@ -16,16 +16,17 @@ """ from __future__ import division, print_function, absolute_import -import ConfigParser import hashlib +import six.moves.configparser import os import re import anteater.utils.anteater_logger as antlog -import anteater.src.get_lists as get_lists from binaryornot.check import is_binary +from . import get_lists + logger = antlog.Logger(__name__).getLogger() -config = ConfigParser.RawConfigParser() +config = six.moves.configparser.RawConfigParser() config.read('anteater.conf') reports_dir = config.get('config', 'reports_dir') master_list = config.get('config', 'master_list') -- cgit 1.2.3-korg