mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[2.2.x] Refs #30323 -- Prevented crash of autoreloader when get_resolver().urlconf_module raising an exception.
Backport of 0636d4d2aa from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							4f8ebdd098
						
					
				
				
					commit
					097457afe4
				
			| @@ -269,7 +269,12 @@ class BaseReloader: | ||||
|         from django.urls import get_resolver | ||||
|         # Prevent a race condition where URL modules aren't loaded when the | ||||
|         # reloader starts by accessing the urlconf_module property. | ||||
|         get_resolver().urlconf_module | ||||
|         try: | ||||
|             get_resolver().urlconf_module | ||||
|         except Exception: | ||||
|             # Loading the urlconf can result in errors during development. | ||||
|             # If this occurs then swallow the error and continue. | ||||
|             pass | ||||
|         logger.debug('Apps ready_event triggered. Sending autoreload_started signal.') | ||||
|         autoreload_started.send(sender=self) | ||||
|         self.run_loop() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user