mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Do not assign new fp attribute to image when closing
This commit is contained in:
		
							parent
							
								
									b25ece364b
								
							
						
					
					
						commit
						67e1253202
					
				| 
						 | 
				
			
			@ -1027,7 +1027,6 @@ class TestImage:
 | 
			
		|||
 | 
			
		||||
            assert len(self._caplog.records) == 0
 | 
			
		||||
            assert im.fp is None
 | 
			
		||||
            assert copy.fp is None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class MockEncoder:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -549,8 +549,8 @@ class Image:
 | 
			
		|||
        :py:meth:`~PIL.Image.Image.load` method. See :ref:`file-handling` for
 | 
			
		||||
        more information.
 | 
			
		||||
        """
 | 
			
		||||
        try:
 | 
			
		||||
        if hasattr(self, "fp"):
 | 
			
		||||
            try:
 | 
			
		||||
                if getattr(self, "_fp", False):
 | 
			
		||||
                    if self._fp != self.fp:
 | 
			
		||||
                        self._fp.close()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user