From: Dario Date: Sun, 11 Dec 2016 16:57:31 +0000 (+0100) Subject: Catch AttributeError in cpu_count() X-Git-Tag: v4.5.0~50^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fec053eb921c71b6e82ba4302577fa99987cb9fb;p=thirdparty%2Ftornado.git Catch AttributeError in cpu_count() Running ```Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32``` on Windows 10 64 Bit Noticed this issue while running ```tox``` with ```pytest tornado 0.4.5``` and ```tornado 4.4.2```. --- diff --git a/tornado/process.py b/tornado/process.py index df61eba67..7c876494c 100644 --- a/tornado/process.py +++ b/tornado/process.py @@ -67,7 +67,7 @@ def cpu_count(): pass try: return os.sysconf("SC_NPROCESSORS_CONF") - except ValueError: + except (AttributeError, ValueError): pass gen_log.error("Could not detect number of processors; assuming 1") return 1