mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	Added check for flush method existense for file-like object in tiffplugin setup
This commit is contained in:
		
							parent
							
								
									bbc6f7d6bb
								
							
						
					
					
						commit
						a2b6b661d9
					
				| 
						 | 
				
			
			@ -935,6 +935,8 @@ class TiffImageFile(ImageFile.ImageFile):
 | 
			
		|||
                    # flush the file descriptor, prevents error on pypy 2.4+
 | 
			
		||||
                    # should also eliminate the need for fp.tell for py3
 | 
			
		||||
                    # in _seek
 | 
			
		||||
                    # flush method may not exist for file-like object.
 | 
			
		||||
                    if hasattr(self.fp, 'flush'):
 | 
			
		||||
                        self.fp.flush()
 | 
			
		||||
                except IOError:
 | 
			
		||||
                    # io.BytesIO have a fileno, but returns an IOError if
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user