Selaa lähdekoodia

Fix a bug and typo

Cammy 7 vuotta sitten
vanhempi
commit
ddc01cc563
2 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 1 1
      pyinstalive/auth.py
  2. 6 3
      pyinstalive/initialize.py

+ 1 - 1
pyinstalive/auth.py

@@ -92,7 +92,7 @@ def login(username, password, show_cookie_expiry, force_use_login_args):
 	except Exception as e:
 		if (str(e).startswith("unsupported pickle protocol")):
 			log("[W] This cookie file is not compatible with Python {}.".format(sys.version.split(' ')[0][0]), "YELLOW")
-			log("[W] Please delete your cookie file '{}.json' and try again.".format(useranem), "YELLOW")
+			log("[W] Please delete your cookie file '{}.json' and try again.".format(username), "YELLOW")
 		else:
 			log('[E] Unexpected Exception: {0!s}'.format(e), "RED")
 		seperator("GREEN")

+ 6 - 3
pyinstalive/initialize.py

@@ -172,9 +172,12 @@ def show_info(config):
 		for file in os.listdir(os.getcwd()):
 			if file.endswith(".json"):
 				with open(file) as data_file:    
-					json_data = json.load(data_file)
-					if (json_data.get('created_ts')):
-						cookie_files.append(file)
+					try:
+						json_data = json.load(data_file)
+						if (json_data.get('created_ts')):
+							cookie_files.append(file)
+					except Exception as e:
+						pass
 			if settings.username == file.replace(".json", ''):
 				cookie_from_config = file
 	except Exception as e: