Use `.is_debug_mode()` for maybe-crash-handling
Such that the default is `None` and in the case where the caller *does not* set the `pdb` arg to an explicit `bool` we instead determine it via the output from `._state.is_debug_mode()` allowing for more "nonchalant" usage throughout a (test) code base which passes the `debug_mode: bool` as runtime config; allows delegation to the per-actor proc-global state.repl_fixture
							parent
							
								
									96a4d381df
								
							
						
					
					
						commit
						166a252d4e
					
				| 
						 | 
				
			
			@ -3280,7 +3280,7 @@ def open_crash_handler(
 | 
			
		|||
 | 
			
		||||
@cm
 | 
			
		||||
def maybe_open_crash_handler(
 | 
			
		||||
    pdb: bool = False,
 | 
			
		||||
    pdb: bool|None = None,
 | 
			
		||||
    tb_hide: bool = True,
 | 
			
		||||
 | 
			
		||||
    **kwargs,
 | 
			
		||||
| 
						 | 
				
			
			@ -3291,7 +3291,11 @@ def maybe_open_crash_handler(
 | 
			
		|||
 | 
			
		||||
    Normally this is used with CLI endpoints such that if the --pdb
 | 
			
		||||
    flag is passed the pdb REPL is engaed on any crashes B)
 | 
			
		||||
 | 
			
		||||
    '''
 | 
			
		||||
    if pdb is None:
 | 
			
		||||
        pdb: bool = _state.is_debug_mode()
 | 
			
		||||
 | 
			
		||||
    __tracebackhide__: bool = tb_hide
 | 
			
		||||
 | 
			
		||||
    rtctx = nullcontext(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue