Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Avoid LocalUnboundError in login (#541)
Browse files Browse the repository at this point in the history
fix LocalUnboundError in login
  • Loading branch information
christopher-dG authored and simon-weber committed Feb 26, 2017
1 parent 18c4487 commit bab8e59
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gmusicapi/clients/mobileclient.py
Expand Up @@ -131,14 +131,16 @@ def login(self, email, password, android_id, locale='en_US'):
" Provide an android_id (and be"
" sure to provide the same one on future runs).")

android_id = utils.create_mac_string(mac_int)
android_id = android_id.replace(':', '')
device_id = utils.create_mac_string(mac_int)
device_id = device_id.replace(':', '')
else:
device_id = android_id

if not self.session.login(email, password, android_id):
if not self.session.login(email, password, device_id):
self.logger.info("failed to authenticate")
return False

self.android_id = self._validate_device_id(android_id, is_mac=is_mac)
self.android_id = self._validate_device_id(device_id, is_mac=is_mac)
self.logger.info("authenticated")

self.locale = locale
Expand Down

0 comments on commit bab8e59

Please sign in to comment.