mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-06-06 14:05:21 -04:00
Fix #550
This commit is contained in:
@@ -248,6 +248,13 @@ def sanitize_file_name(name):
|
||||
|
||||
def detect_ncpus():
|
||||
"""Detects the number of effective CPUs in the system"""
|
||||
try:
|
||||
from PyQt4.QtCore import QThread
|
||||
ans = QThread.idealThreadCount()
|
||||
if ans > 0:
|
||||
return ans
|
||||
except:
|
||||
pass
|
||||
#for Linux, Unix and MacOS
|
||||
if hasattr(os, "sysconf"):
|
||||
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
|
||||
|
||||
Reference in New Issue
Block a user