

def _configure_niceness(kwargs):
    'Sets niceness of a process'
    niceness = current['niceness']
    if (niceness is not None):
        try:
            try:
                current = os.nice(0)
                if ((niceness - current) > 0):
                    os.nice((niceness - current))
            except AttributeError:
                psutil.Process().nice(niceness)
        except Exception as exc:
            sys.stderr.write(('Could not configure niceness because of: %s' % repr(exc)))
            traceback.print_exc()

dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/environment.py _configure_niceness/VarMisuse@14/30 `kwargs`->`current`