mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #26026 -- Fixed isinstance crash comparing EmptyQuerySet to non-QuerySet.
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							b643386668
						
					
				
				
					commit
					b5f8c81ce1
				
			| @@ -1171,7 +1171,7 @@ class QuerySet(object): | ||||
|  | ||||
| class InstanceCheckMeta(type): | ||||
|     def __instancecheck__(self, instance): | ||||
|         return instance.query.is_empty() | ||||
|         return isinstance(instance, QuerySet) and instance.query.is_empty() | ||||
|  | ||||
|  | ||||
| class EmptyQuerySet(six.with_metaclass(InstanceCheckMeta)): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user