mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-31 16:07:44 +03:00 
			
		
		
		
	Fix temporary Session fields not being defined
This commit is contained in:
		
							parent
							
								
									2af962230f
								
							
						
					
					
						commit
						8d9e50989b
					
				|  | @ -104,24 +104,24 @@ class JsonSession: | ||||||
|            those required to init a connection will be copied. |            those required to init a connection will be copied. | ||||||
|         """ |         """ | ||||||
|         # These values will NOT be saved |         # These values will NOT be saved | ||||||
|         if isinstance(session_user_id, str): |         if isinstance(session_user_id, JsonSession): | ||||||
|             self.session_user_id = session_user_id |  | ||||||
| 
 |  | ||||||
|             # For connection purposes |  | ||||||
|             self.device_model = platform.node() |  | ||||||
|             self.system_version = platform.system() |  | ||||||
|             self.app_version = '1.0'  # note: '0' will provoke error |  | ||||||
|             self.lang_code = 'en' |  | ||||||
| 
 |  | ||||||
|         elif isinstance(session_user_id, JsonSession): |  | ||||||
|             self.session_user_id = None |             self.session_user_id = None | ||||||
| 
 | 
 | ||||||
|  |             # For connection purposes | ||||||
|             session = session_user_id |             session = session_user_id | ||||||
|             self.device_model = session.device_model |             self.device_model = session.device_model | ||||||
|             self.system_version = session.system_version |             self.system_version = session.system_version | ||||||
|             self.app_version = session.app_version |             self.app_version = session.app_version | ||||||
|             self.lang_code = session.lang_code |             self.lang_code = session.lang_code | ||||||
| 
 | 
 | ||||||
|  |         else:  # str / None | ||||||
|  |             self.session_user_id = session_user_id | ||||||
|  | 
 | ||||||
|  |             self.device_model = platform.node() | ||||||
|  |             self.system_version = platform.system() | ||||||
|  |             self.app_version = '1.0'  # note: '0' will provoke error | ||||||
|  |             self.lang_code = 'en' | ||||||
|  | 
 | ||||||
|         # Cross-thread safety |         # Cross-thread safety | ||||||
|         self._lock = Lock() |         self._lock = Lock() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user