Bug 1395392 - Clean up unnecessary variable. r?chmanchester draft
authorRalph Giles <giles@mozilla.com>
Wed, 30 Aug 2017 16:39:06 -0700
changeset 657817 9ec3c50a1841c95327668ee6e376bed2344b53c4
parent 657816 0e0c6a866dc344c75110499b979bd873ffd7ba13
child 657818 3f74b09f4d82d09721a799381cf6873d4bc3363e
push id77628
push userbmo:giles@thaumas.net
push dateSat, 02 Sep 2017 00:14:53 +0000
reviewerschmanchester
bugs1395392
milestone57.0a1
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
toolkit/moz.configure
--- 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'