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: ...@@ -80,11 +80,8 @@ try:
import psutil import psutil
if platform.system() != "Windows": if platform.system() != "Windows":
p = psutil.Process(os.getpid()) import resource
if hasattr(p, "rlimit"): nice_limit, _ = resource.getrlimit(psutil.RLIMIT_NICE)
nice_limit, _ = p.rlimit(psutil.RLIMIT_NICE)
else:
nice_limit, _ = p.get_rlimit(psutil.RLIMIT_NICE)
high_priority_nice = 20 - nice_limit high_priority_nice = 20 - nice_limit
def set_nice(nice): 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