From 49a73d0901a60b1b77452b92372fd8629f636c2a Mon Sep 17 00:00:00 2001 From: johnthagen Date: Mon, 9 Oct 2017 08:16:18 -0700 Subject: [PATCH] Add __future__ imports to increase compatibility with Python 3. Derive Option from object to make it a new-style class for Python 3 compatibility. --- src/bootstrap/bootstrap.py | 2 +- src/bootstrap/bootstrap_test.py | 1 + src/bootstrap/configure.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 4a8c3dcebcb..fecb8e6a05e 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -8,7 +8,7 @@ # option. This file may not be copied, modified, or distributed # except according to those terms. -from __future__ import print_function +from __future__ import absolute_import, division, print_function import argparse import contextlib import datetime diff --git a/src/bootstrap/bootstrap_test.py b/src/bootstrap/bootstrap_test.py index 32ea4b4abe6..4db7e2ec016 100644 --- a/src/bootstrap/bootstrap_test.py +++ b/src/bootstrap/bootstrap_test.py @@ -10,6 +10,7 @@ """Bootstrap tests""" +from __future__ import absolute_import, division, print_function import os import doctest import unittest diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 67337bf4421..3c161b7bb14 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -11,6 +11,7 @@ # ignore-tidy-linelength +from __future__ import absolute_import, division, print_function import sys import os rust_dir = os.path.dirname(os.path.abspath(__file__)) @@ -19,7 +20,7 @@ rust_dir = os.path.dirname(rust_dir) sys.path.append(os.path.join(rust_dir, "src", "bootstrap")) import bootstrap -class Option: +class Option(object): def __init__(self, name, rustbuild, desc, value): self.name = name self.rustbuild = rustbuild