for field, disp in display_fields:
if field in ('uptime', 'cputime') and locals()[field] is not None:
fields.append((disp, locals()[field]))
for field, disp in display_fields:
if field in ('uptime', 'cputime') and locals()[field] is not None:
fields.append((disp, locals()[field]))