mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #550
This commit is contained in:
parent
0aa53a163a
commit
3f09644181
@ -248,6 +248,13 @@ def sanitize_file_name(name):
|
|||||||
|
|
||||||
def detect_ncpus():
|
def detect_ncpus():
|
||||||
"""Detects the number of effective CPUs in the system"""
|
"""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
|
#for Linux, Unix and MacOS
|
||||||
if hasattr(os, "sysconf"):
|
if hasattr(os, "sysconf"):
|
||||||
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
|
if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user