mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-31 07:57:38 +03:00 
			
		
		
		
	Replace type(...) == ... with isinstance() checks
This commit is contained in:
		
							parent
							
								
									65d5ab685f
								
							
						
					
					
						commit
						c0bae1d608
					
				|  | @ -724,11 +724,11 @@ class TelegramClient(TelegramBareClient): | |||
| 
 | ||||
|         if os.path.isdir(file) or not file: | ||||
|             for attr in document.attributes: | ||||
|                 if type(attr) == DocumentAttributeFilename: | ||||
|                 if isinstance(attr, DocumentAttributeFilename): | ||||
|                     file = os.path.join(file, attr.file_name) | ||||
|                     break  # This attribute has higher preference | ||||
| 
 | ||||
|                 elif type(attr) == DocumentAttributeAudio: | ||||
|                 elif isinstance(attr, DocumentAttributeAudio): | ||||
|                     file = os.path.join( | ||||
|                         file, '{} - {}'.format(attr.performer, attr.title) | ||||
|                     ) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user