You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defset_process_priority(pid=None, priority_order=1):
...
process=psutil.Process(pidifpidelseos.getpid())
ifsys.platform=='win32':
...
elifsys.platform=='darwin'orsys.platform=='linux2':
# On Unix, priority can be -20 to 20, but usually not allowed to set below 0, we set our classes somewhat in# that range.priority_classes= [5, 4, 3, 2, 1, 0]
process.nice(priority_classes[priority_order]) # <-- here
It looks like we should wrap the process.nice call with try/except block, catch the psutil.AccessDenied exception, and log it (probably put try/except at the top level of the function to catch possible Windows errors as well).
The text was updated successfully, but these errors were encountered:
Here:
It looks like we should wrap the
process.nice
call with try/except block, catch thepsutil.AccessDenied
exception, and log it (probably put try/except at the top level of the function to catch possible Windows errors as well).The text was updated successfully, but these errors were encountered: