Skip to content

Commit

Permalink
Ensure device model is non-empty (closes #154)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Jul 4, 2017
1 parent 9bb6353 commit 632fcb7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions telethon/tl/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ def __init__(self, session_user_id):
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
system = platform.uname()
self.device_model = system.system if system.system else 'Unknown'
self.system_version = system.release if system.release else '1.0'
self.app_version = '1.0' # '0' will provoke error
self.lang_code = 'en'
self.system_lang_code = self.lang_code
self.lang_pack = ''
Expand Down

0 comments on commit 632fcb7

Please sign in to comment.