mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 18:08:03 +03:00 
			
		
		
		
	Pass through memo in __deepcopy__ as required by the docs (#6660)
This is needed to avoid problems with recursive loops. See https://docs.python.org/3.7/library/copy.html toward the end.
This commit is contained in:
		
							parent
							
								
									a7c577cb31
								
							
						
					
					
						commit
						9811a29a5a
					
				| 
						 | 
				
			
			@ -614,7 +614,7 @@ class Field:
 | 
			
		|||
            for item in self._args
 | 
			
		||||
        ]
 | 
			
		||||
        kwargs = {
 | 
			
		||||
            key: (copy.deepcopy(value) if (key not in ('validators', 'regex')) else value)
 | 
			
		||||
            key: (copy.deepcopy(value, memo) if (key not in ('validators', 'regex')) else value)
 | 
			
		||||
            for key, value in self._kwargs.items()
 | 
			
		||||
        }
 | 
			
		||||
        return self.__class__(*args, **kwargs)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user