@@ -453,7 +453,7 @@ def __call__(self, event):
453453 if event .kind == 'call' :
454454 if event .builtin :
455455 self .output (
456- '{}{}{}{KIND}{:9} {}{COLOR} >{NORMAL } {}.{}: {}{RESET}\n ' ,
456+ '{}{}{}{KIND}{:9} {}{COLOR} >{BUILTIN } {}.{}: {}{RESET}\n ' ,
457457 pid_prefix ,
458458 thread_prefix ,
459459 filename_prefix ,
@@ -462,7 +462,7 @@ def __call__(self, event):
462462 event .module ,
463463 event .function ,
464464 self .try_source (event ).strip (),
465- COLOR = self .event_colors [ 'builtin' ] ,
465+ COLOR = self .event_colors . get ( event . kind ) ,
466466 )
467467 else :
468468 code = event .code
@@ -484,29 +484,42 @@ def __call__(self, event):
484484 COLOR = self .event_colors .get (event .kind ),
485485 )
486486 elif event .kind == 'exception' :
487- self .output (
488- '{}{}{}{KIND}{:9} {}{COLOR} !{NORMAL} {}: {RESET}{}\n ' ,
489- pid_prefix ,
490- thread_prefix ,
491- filename_prefix ,
492- event .kind ,
493- ' ' * (len (stack ) - 1 ),
494- event .function ,
495- self .try_str (event .arg ) if event .detached else self .try_repr (event .arg ),
496- COLOR = self .event_colors .get (event .kind ),
497- )
487+ if event .builtin :
488+ self .output (
489+ '{}{}{}{KIND}{:9} {}{COLOR} ! {BUILTIN}{}.{}{RESET}\n ' ,
490+ pid_prefix ,
491+ thread_prefix ,
492+ filename_prefix ,
493+ event .kind ,
494+ ' ' * (len (stack ) - 1 ),
495+ event .module ,
496+ event .function ,
497+ COLOR = self .event_colors .get (event .kind ),
498+ )
499+ else :
500+ self .output (
501+ '{}{}{}{KIND}{:9} {}{COLOR} !{NORMAL} {}: {RESET}{}\n ' ,
502+ pid_prefix ,
503+ thread_prefix ,
504+ filename_prefix ,
505+ event .kind ,
506+ ' ' * (len (stack ) - 1 ),
507+ event .function ,
508+ self .try_str (event .arg ) if event .detached else self .try_repr (event .arg ),
509+ COLOR = self .event_colors .get (event .kind ),
510+ )
498511 elif event .kind == 'return' :
499512 if event .builtin :
500513 self .output (
501- '{}{}{}{KIND}{:9} {}{COLOR} <{NORMAL } {}.{}{RESET}\n ' ,
514+ '{}{}{}{KIND}{:9} {}{COLOR} <{BUILTIN } {}.{}{RESET}\n ' ,
502515 pid_prefix ,
503516 thread_prefix ,
504517 filename_prefix ,
505518 event .kind ,
506519 ' ' * (len (stack ) - 1 ),
507520 event .module ,
508521 event .function ,
509- COLOR = self .event_colors [ 'builtin' ] ,
522+ COLOR = self .event_colors . get ( event . kind ) ,
510523 )
511524 else :
512525 self .output (
0 commit comments