Skip to content

Commit 7138038

Browse files
theotherjimmyadbridge
authored andcommitted
Correct get_config imports
1 parent 43e646d commit 7138038

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

tools/get_config.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
limitations under the License.
1717
1818
"""
19+
from __future__ import print_function
1920
import sys
2021
from os.path import isdir, abspath, dirname, join
2122
from os import _exit
@@ -28,8 +29,8 @@
2829
from tools.options import get_default_options_parser
2930
from tools.options import extract_mcus
3031
from tools.build_api import get_config
31-
from config import Config
32-
from utils import argparse_filestring_type
32+
from tools.config import Config
33+
from tools.utils import argparse_filestring_type
3334
try:
3435
import tools.private_settings as ps
3536
except:
@@ -62,31 +63,31 @@
6263
try:
6364
params, macros, features = get_config(options.source_dir, target, toolchain)
6465
if not params and not macros:
65-
print "No configuration data available."
66+
print("No configuration data available.")
6667
_exit(0)
6768
if params:
68-
print "Configuration parameters"
69-
print "------------------------"
69+
print("Configuration parameters")
70+
print("------------------------")
7071
for p in sorted(params):
7172
for s in options.prefix:
7273
if p.startswith(s):
7374
print(str(params[p]) if not options.verbose else params[p].get_verbose_description())
7475
break
75-
print ""
76+
print("")
7677

77-
print "Macros"
78-
print "------"
78+
print("Macros")
79+
print("------")
7980
if macros:
80-
print 'Defined with "macros":', Config.config_macros_to_macros(macros)
81-
print "Generated from configuration parameters:", Config.parameters_to_macros(params)
81+
print('Defined with "macros":', Config.config_macros_to_macros(macros))
82+
print("Generated from configuration parameters:", Config.parameters_to_macros(params))
8283

83-
except KeyboardInterrupt, e:
84-
print "\n[CTRL+c] exit"
85-
except Exception,e:
84+
except KeyboardInterrupt as e:
85+
print("\n[CTRL+c] exit")
86+
except Exception as e:
8687
if options.verbose:
8788
import traceback
8889
traceback.print_exc(file=sys.stdout)
8990
else:
90-
print "[ERROR] %s" % str(e)
91+
print("[ERROR] %s" % str(e))
9192

9293
sys.exit(1)

0 commit comments

Comments
 (0)