Remove Python 2.5 support from WebKit
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 23:11:46 +0000 (23:11 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 23:11:46 +0000 (23:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=71593

Reviewed by Adam Barth.

Just removing support from this one core file.
I'll commit the rest of the (large) change once we've
gone 24 hours and seen that no bots have exploded.
We can roll out this one change if we break bots
and then roll in the rest once those bots are fixed.

* Scripts/webkitpy/common/system/executive.py:
(Executive.cpu_count):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105931 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/common/system/executive.py

index 2e3d8bc..6a9cd1c 100644 (file)
@@ -1,3 +1,19 @@
+2012-01-25  Eric Seidel  <eric@webkit.org>
+
+        Remove Python 2.5 support from WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=71593
+
+        Reviewed by Adam Barth.
+
+        Just removing support from this one core file.
+        I'll commit the rest of the (large) change once we've
+        gone 24 hours and seen that no bots have exploded.
+        We can roll out this one change if we break bots
+        and then roll in the rest once those bots are fixed.
+
+        * Scripts/webkitpy/common/system/executive.py:
+        (Executive.cpu_count):
+
 2012-01-25  Hajime Morita  <morrita@google.com>
 
         ENABLE_SHADOW_DOM should be available via build-webkit --shadow-dom
index 0481f04..06f870c 100644 (file)
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-try:
-    # This API exists only in Python 2.6 and higher.  :(
-    import multiprocessing
-except ImportError:
-    multiprocessing = None
-
+import multiprocessing
 import ctypes
 import errno
 import logging
@@ -160,21 +155,7 @@ class Executive(object):
         return child_output
 
     def cpu_count(self):
-        if multiprocessing:
-            return multiprocessing.cpu_count()
-        # Darn.  We don't have the multiprocessing package.
-        system_name = platform.system()
-        if system_name == "Darwin":
-            return int(self.run_command(["sysctl", "-n", "hw.ncpu"]))
-        elif system_name == "Windows":
-            return int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
-        elif system_name == "Linux":
-            num_cores = os.sysconf("SC_NPROCESSORS_ONLN")
-            if isinstance(num_cores, int) and num_cores > 0:
-                return num_cores
-        # This quantity is a lie but probably a reasonable guess for modern
-        # machines.
-        return 2
+        return multiprocessing.cpu_count()
 
     @staticmethod
     def interpreter_for_script(script_path, fs=None):