Commit 4868798a authored by Guillaume Seguin's avatar Guillaume Seguin

Use resource instead of psutil to get min nice

parent 35d20f38
......@@ -80,11 +80,8 @@ try:
import psutil
if platform.system() != "Windows":
p = psutil.Process(os.getpid())
if hasattr(p, "rlimit"):
nice_limit, _ = p.rlimit(psutil.RLIMIT_NICE)
else:
nice_limit, _ = p.get_rlimit(psutil.RLIMIT_NICE)
import resource
nice_limit, _ = resource.getrlimit(psutil.RLIMIT_NICE)
high_priority_nice = 20 - nice_limit
def set_nice(nice):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment