Skip to content

Commit c937f5b

Browse files
committed
build: fix up style issues in configure script
* Use single quotes consistently. * Remove a few stray semicolons. * Fix up some overly long lines. * Line up a few expressions.
1 parent 52e47b2 commit c937f5b

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

configure

+18-14
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,15 @@ def host_arch_win():
406406

407407
def compiler_version():
408408
try:
409-
proc = subprocess.Popen(shlex.split(CC) + ['--version'], stdout=subprocess.PIPE)
409+
proc = subprocess.Popen(shlex.split(CC) + ['--version'],
410+
stdout=subprocess.PIPE)
410411
except WindowsError:
411412
return (0, False)
412413

413414
is_clang = 'clang' in proc.communicate()[0].split('\n')[0]
414415

415-
proc = subprocess.Popen(shlex.split(CC) + ['-dumpversion'], stdout=subprocess.PIPE)
416+
proc = subprocess.Popen(shlex.split(CC) + ['-dumpversion'],
417+
stdout=subprocess.PIPE)
416418
version = tuple(map(int, proc.communicate()[0].split('.')))
417419

418420
return (version, is_clang)
@@ -432,7 +434,7 @@ def configure_arm(o):
432434

433435
def configure_node(o):
434436
if options.dest_os == 'android':
435-
o['variables']['OS'] = "android"
437+
o['variables']['OS'] = 'android'
436438
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
437439
o['variables']['v8_no_strict_aliasing'] = 1 # work around compiler bugs
438440
o['variables']['node_prefix'] = os.path.expanduser(options.prefix or '')
@@ -488,15 +490,15 @@ def configure_node(o):
488490

489491
# By default, enable ETW on Windows.
490492
if flavor == 'win':
491-
o['variables']['node_use_etw'] = b(not options.without_etw);
493+
o['variables']['node_use_etw'] = b(not options.without_etw)
492494
elif options.with_etw:
493495
raise Exception('ETW is only supported on Windows.')
494496
else:
495497
o['variables']['node_use_etw'] = 'false'
496498

497499
# By default, enable Performance counters on Windows.
498500
if flavor == 'win':
499-
o['variables']['node_use_perfctr'] = b(not options.without_perfctr);
501+
o['variables']['node_use_perfctr'] = b(not options.without_perfctr)
500502
elif options.with_perfctr:
501503
raise Exception('Performance counter is only supported on Windows.')
502504
else:
@@ -611,22 +613,24 @@ def configure_winsdk(o):
611613
if flavor != 'win':
612614
return
613615

614-
winsdk_dir = os.environ.get("WindowsSdkDir")
616+
winsdk_dir = os.environ.get('WindowsSdkDir')
615617

616618
if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\ctrpp.exe'):
617-
print "Found ctrpp in WinSDK--will build generated files into tools/msvs/genfiles."
619+
print('Found ctrpp in WinSDK--will build generated files '
620+
'into tools/msvs/genfiles.')
618621
o['variables']['node_has_winsdk'] = 'true'
619622
return
620623

621-
print "ctrpp not found in WinSDK path--using pre-gen files from tools/msvs/genfiles."
624+
print('ctrpp not found in WinSDK path--using pre-gen files '
625+
'from tools/msvs/genfiles.')
622626

623627

624628
# determine the "flavor" (operating system) we're building for,
625629
# leveraging gyp's GetFlavor function
626-
flavor_params = {};
630+
flavor_params = {}
627631
if (options.dest_os):
628-
flavor_params['flavor'] = options.dest_os;
629-
flavor = GetFlavor(flavor_params);
632+
flavor_params['flavor'] = options.dest_os
633+
flavor = GetFlavor(flavor_params)
630634

631635
output = {
632636
'variables': { 'python': sys.executable },
@@ -658,12 +662,12 @@ pprint.pprint(output, indent=2)
658662

659663
def write(filename, data):
660664
filename = os.path.join(root_dir, filename)
661-
print "creating ", filename
665+
print 'creating ', filename
662666
f = open(filename, 'w+')
663667
f.write(data)
664668

665-
write('config.gypi', "# Do not edit. Generated by the configure script.\n" +
666-
pprint.pformat(output, indent=2) + "\n")
669+
write('config.gypi', '# Do not edit. Generated by the configure script.\n' +
670+
pprint.pformat(output, indent=2) + '\n')
667671

668672
config = {
669673
'BUILDTYPE': 'Debug' if options.debug else 'Release',

0 commit comments

Comments
 (0)