$NUMBER_OF_PROCESSORS is used in webkitperl, it'd be nice to have support for it in webkitpy too.
Created attachment 197852 [details] Patch
Comment on attachment 197852 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=197852&action=review > Tools/Scripts/webkitpy/common/system/executive.py:145 > + if 'NUMBER_OF_PROCESSORS' in os.environ: This test can be removed. os.environ.get() will return None if the env var is not set, I think. > Tools/Scripts/webkitpy/common/system/executive.py:150 > + except: please explicitely catch ValueError :)
Created attachment 198023 [details] Patch os.environ.get() returns None, but None has type NoneType and if you use it in int() it raises a TypeError exception instead of a ValueError. So, I've kept the if checking that the environment variable is defined and then I've added ValueError in the catch clause.
(In reply to comment #3) > Created an attachment (id=198023) [details] > Patch > > os.environ.get() returns None, but None has type NoneType and if you use it in int() it raises a TypeError exception instead of a ValueError. So, I've kept the if checking that the environment variable is defined and then I've added ValueError in the catch clause. Well, it's possible to catch multiple exceptions with a single except or even multiple except statements :)
Created attachment 198048 [details] Patch
(In reply to comment #3) > Created an attachment (id=198023) [details] > Patch > > os.environ.get() returns None, but None has type NoneType and if you use it in int() it raises a TypeError exception instead of a ValueError. So, I've kept the if checking that the environment variable is defined and then I've added ValueError in the catch clause. It's possible to define the default value that's to be returned when the searched item is not present in the dictionary. In this case it would probably be 0. http://docs.python.org/2/library/stdtypes.html#dict.get Also, mildly interesting, the ẁ (U+1E81) in the [ẁebkitpy] tag in the title does not get reflected in the changelog.
Comment on attachment 198048 [details] Patch Clearing flags on attachment: 198048 Committed r148429: <http://trac.webkit.org/changeset/148429>
All reviewed patches have been landed. Closing bug.