forked from goodboy/tractor
				
			Add debug example that causes pdb stdin clobbering
							parent
							
								
									a1603709ab
								
							
						
					
					
						commit
						6f19fa3107
					
				|  | @ -0,0 +1,31 @@ | ||||||
|  | 
 | ||||||
|  | import trio | ||||||
|  | import tractor | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | async def key_error(): | ||||||
|  |     "Raise a ``NameError``" | ||||||
|  |     return {}['doggy'] | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | async def main(): | ||||||
|  |     """Root dies  | ||||||
|  | 
 | ||||||
|  |     """ | ||||||
|  |     async with tractor.open_nursery( | ||||||
|  |         debug_mode=True, | ||||||
|  |         loglevel='debug' | ||||||
|  |     ) as n: | ||||||
|  | 
 | ||||||
|  |         # spawn both actors | ||||||
|  |         portal = await n.run_in_actor(key_error) | ||||||
|  | 
 | ||||||
|  |         # XXX: originally a bug causes by this | ||||||
|  |         # where root would enter debugger even | ||||||
|  |         # though child should have it locked. | ||||||
|  |         with trio.fail_after(1): | ||||||
|  |             await trio.Event().wait() | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | if __name__ == '__main__': | ||||||
|  |     trio.run(main) | ||||||
		Loading…
	
		Reference in New Issue