• Rafael Fonseca's avatar
    llcstat: fix TypeError on python3 · f2e6b8d2
    Rafael Fonseca authored
    The bytes object has no __format__ method of its own, inheriting it from
    object, so an exception is thrown in python3 when it's passed to a
    formatted string since formatting instructions are type specific.
    
    $: ./llcstat
    Running for 10 seconds or hit Ctrl-C to end.
    PID      NAME             CPU     REFERENCE         MISS    HIT%
    Traceback (most recent call last):
      File "./llcstat", line 108, in <module>
        (float(hit) / float(v.value)) * 100.0))
    TypeError: non-empty format string passed to object.__format__
    f2e6b8d2
llcstat.py 3.35 KB