]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Catch AttributeError in cpu_count() 1911/head
authorDario <medariox@users.noreply.github.com>
Sun, 11 Dec 2016 16:57:31 +0000 (17:57 +0100)
committerGitHub <noreply@github.com>
Sun, 11 Dec 2016 16:57:31 +0000 (17:57 +0100)
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```.

tornado/process.py

index df61eba670682f1c41ac7c14ef634cdf956bdd5d..7c876494cb7f24f157c294133eb3ddee8dcf456f 100644 (file)
@@ -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