+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
# (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
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):