Changeset 56336 in webkit
- Timestamp:
- Mar 22, 2010 9:24:32 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r56335 r56336 1 2010-03-22 Chris Jerdonek <cjerdonek@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Refactored the cpu_count() code in executive.py. 6 7 https://bugs.webkit.org/show_bug.cgi?id=36437 8 9 * Scripts/webkitpy/executive.py: 10 - Moved the import of the multiprocessing module to the top 11 of the file rather than importing from within a function. 12 1 13 2010-03-22 Antonio Gomes <tonikitoo@webkit.org> 2 14 -
trunk/WebKitTools/Scripts/webkitpy/executive.py
r53896 r56336 27 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 30 try: 31 # This API exists only in Python 2.6 and higher. :( 32 import multiprocessing 33 except ImportError: 34 multiprocessing = None 29 35 30 36 import os … … 114 120 @staticmethod 115 121 def cpu_count(): 116 # This API exists only in Python 2.6 and higher. :( 117 try: 118 import multiprocessing 122 if multiprocessing: 119 123 return multiprocessing.cpu_count() 120 except (ImportError, NotImplementedError): 121 # This quantity is a lie but probably a reasonable guess for modern 122 # machines. 123 return 2 124 # This quantity is a lie but probably a reasonable guess for modern 125 # machines. 126 return 2 124 127 125 128 # Error handlers do not need to be static methods once all callers are
Note: See TracChangeset
for help on using the changeset viewer.