Title: [267508] trunk/Tools
Revision
267508
Author
[email protected]
Date
2020-09-23 16:28:50 -0700 (Wed, 23 Sep 2020)

Log Message

webkitpy: Make sw_vers the source of truth for the MacOS version
https://bugs.webkit.org/show_bug.cgi?id=216903
<rdar://problem/69462735>

Reviewed by Dewei Zhu.

* Scripts/webkitpy/common/system/platforminfo.py:
(PlatformInfo.__init__): Use sw_vers instead of platform.mac_ver().
* Scripts/webkitpy/common/system/platforminfo_unittest.py:
(fake_executive): Set a valid return value for sw_vers by default.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (267507 => 267508)


--- trunk/Tools/ChangeLog	2020-09-23 23:25:31 UTC (rev 267507)
+++ trunk/Tools/ChangeLog	2020-09-23 23:28:50 UTC (rev 267508)
@@ -1,3 +1,16 @@
+2020-09-23  Jonathan Bedard  <[email protected]>
+
+        webkitpy: Make sw_vers the source of truth for the MacOS version
+        https://bugs.webkit.org/show_bug.cgi?id=216903
+        <rdar://problem/69462735>
+
+        Reviewed by Dewei Zhu.
+
+        * Scripts/webkitpy/common/system/platforminfo.py:
+        (PlatformInfo.__init__): Use sw_vers instead of platform.mac_ver().
+        * Scripts/webkitpy/common/system/platforminfo_unittest.py:
+        (fake_executive): Set a valid return value for sw_vers by default.
+
 2020-09-23  Carlos Garcia Campos  <[email protected]>
 
         [GTK][WPE] Move TLS errors API from WebKitContext to WebKitWebsiteDataManager

Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py (267507 => 267508)


--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py	2020-09-23 23:25:31 UTC (rev 267507)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo.py	2020-09-23 23:28:50 UTC (rev 267508)
@@ -67,7 +67,7 @@
         self._is_cygwin = sys_module.platform == 'cygwin'
 
         if self.os_name.startswith('mac'):
-            self.os_version = Version.from_string(platform_module.mac_ver()[0])
+            self.os_version = Version.from_string(self._executive.run_command(['sw_vers', '-productVersion']).rstrip())
         elif self.os_name.startswith('win'):
             self.os_version = self._win_version()
         else:

Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py (267507 => 267508)


--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py	2020-09-23 23:25:31 UTC (rev 267507)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py	2020-09-23 23:28:50 UTC (rev 267508)
@@ -64,7 +64,7 @@
 def fake_executive(output=None):
     if output:
         return MockExecutive2(output=output)
-    return MockExecutive2(exception=SystemError)
+    return MockExecutive2(output='10.15.0\n')
 
 
 class TestPlatformInfo(unittest.TestCase):
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to