Bug 1395392 - Clean up unnecessary variable. r?chmanchester
The `os` dereference here is only used in the error message,
and using it in the conditional tree doesn't really help
readability since it's too short; the target prefix is
helpful.
MozReview-Commit-ID: 4A8MpRH2r0p
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -115,32 +115,32 @@ option('--enable-default-toolkit', nargs
choices=('cairo-windows', 'cairo-gtk3', 'cairo-gtk3-wayland',
'cairo-cocoa', 'cairo-uikit', 'cairo-android'),
help='Select default toolkit')
@depends('--enable-default-toolkit', target, '--help')
def toolkit(value, target, _):
# Define possible choices for each platform. The default is the first one
# listed when there are several.
- os = target.os
if target.os == 'WINNT':
platform_choices = ('cairo-windows',)
elif target.os == 'OSX':
platform_choices = ('cairo-cocoa',)
elif target.os == 'iOS':
platform_choices = ('cairo-uikit',)
elif target.os == 'Android':
platform_choices = ('cairo-android',)
else:
platform_choices = ('cairo-gtk3', 'cairo-gtk3-wayland')
if value:
if value[0] not in platform_choices:
die('`%s` is not a valid value for --enable-default-toolkit on %s\n'
- 'Valid values: %s', value[0], os, ', '.join(platform_choices))
+ 'Valid values: %s', value[0], target.os,
+ ', '.join(platform_choices))
return value[0]
return platform_choices[0]
@depends(toolkit)
def wayland(toolkit):
return toolkit == 'cairo-gtk3-wayland'