WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-225230-20210430133714.patch (text/plain), 5.18 KB, created by
Jonathan Bedard
on 2021-04-30 13:37:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jonathan Bedard
Created:
2021-04-30 13:37:15 PDT
Size:
5.18 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 276851) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2021-04-30 Jonathan Bedard <jbedard@apple.com> >+ >+ [webkitpy] Support pickling platforminfo >+ https://bugs.webkit.org/show_bug.cgi?id=225230 >+ <rdar://problem/77384913> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkitpy/common/system/platforminfo.py: >+ (PlatformInfo.__init__): Define default arguments. >+ (PlatformInfo.display_name): Use default platform module if platform_module undefined. >+ (PlatformInfo._win_version_str): Ditto. >+ * Scripts/webkitpy/common/system/platforminfo_unittest.py: >+ (TestPlatformInfo.test_real_code): >+ * Scripts/webkitpy/common/system/systemhost.py: >+ (SystemHost.__init__): Use default platforminfo sys and platform modules. >+ > 2021-04-30 Commit Queue <commit-queue@webkit.org> > > Unreviewed, reverting r276846. >Index: Tools/Scripts/webkitpy/common/system/platforminfo.py >=================================================================== >--- Tools/Scripts/webkitpy/common/system/platforminfo.py (revision 276851) >+++ Tools/Scripts/webkitpy/common/system/platforminfo.py (working copy) >@@ -37,7 +37,7 @@ from webkitcorepy import Version > > from webkitpy.common.memoized import memoized > from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE, VersionNameMap >-from webkitpy.common.system.executive import ScriptError >+from webkitpy.common.system.executive import Executive, ScriptError > from webkitpy.port.config import apple_additions > > >@@ -59,8 +59,9 @@ class PlatformInfo(object): > newer than one known to the code. > """ > >- def __init__(self, sys_module, platform_module, executive): >- self._executive = executive >+ def __init__(self, sys_module=None, platform_module=None, executive=None): >+ sys_module = sys_module or sys >+ self._executive = executive or Executive() > self._platform_module = platform_module > self.os_name = self._determine_os_name(sys_module.platform) > self.os_version = None >@@ -77,7 +78,7 @@ class PlatformInfo(object): > self.os_version = self._win_version() > else: > # Most other platforms (namely iOS) return conforming version strings. >- version = re.search(r'\d+.\d+(.\d+)?', platform_module.release()) >+ version = re.search(r'\d+.\d+(.\d+)?', (platform_module or platform).release()) > if version: > self.os_version = Version.from_string(version.group(0)) > else: >@@ -134,12 +135,12 @@ class PlatformInfo(object): > def display_name(self): > # platform.platform() returns Darwin information for Mac, which is just confusing. > if self.is_mac(): >- return "Mac OS X %s" % self._platform_module.mac_ver()[0] >+ return "Mac OS X %s" % (self._platform_module or platform).mac_ver()[0] > > # Returns strings like: > # Linux-2.6.18-194.3.1.el5-i686-with-redhat-5.5-Final > # Windows-2008ServerR2-6.1.7600 >- return self._platform_module.platform() >+ return (self._platform_module or platform).platform() > > def os_version_name(self, table=None): > if not self.os_version: >@@ -246,7 +247,7 @@ class PlatformInfo(object): > return Version.from_iterable(match_object.groups()) > > def _win_version_str(self): >- version = self._platform_module.win32_ver()[1] >+ version = (self._platform_module or platform).win32_ver()[1] > if version: > return version > # Note that this should only ever be called on windows, so this should always work. >Index: Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py (revision 276851) >+++ Tools/Scripts/webkitpy/common/system/platforminfo_unittest.py (working copy) >@@ -75,7 +75,7 @@ class TestPlatformInfo(unittest.TestCase > # yet run by default and there's no reason not to run this everywhere by default. > def test_real_code(self): > # This test makes sure the real (unmocked) code actually works. >- info = PlatformInfo(sys, platform, Executive()) >+ info = PlatformInfo(executive=Executive()) > self.assertNotEqual(info.os_name, '') > if info.is_mac() or info.is_win(): > self.assertIsNotNone(info.os_version) >Index: Tools/Scripts/webkitpy/common/system/systemhost.py >=================================================================== >--- Tools/Scripts/webkitpy/common/system/systemhost.py (revision 276851) >+++ Tools/Scripts/webkitpy/common/system/systemhost.py (working copy) >@@ -38,7 +38,7 @@ class SystemHost(object): > def __init__(self): > self.executive = executive.Executive() > self.filesystem = filesystem.FileSystem() >- self.platform = platforminfo.PlatformInfo(sys, platform, self.executive) >+ self.platform = platforminfo.PlatformInfo(executive=self.executive) > self.user = user.User(self.platform) > self.workspace = workspace.Workspace(self.filesystem, self.executive) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 225230
:
427427
|
427443
|
427608