From c8ef6729addbcfc8356b38eb4fb07beafd901c75 Mon Sep 17 00:00:00 2001 From: up9cloud Date: Tue, 9 May 2017 12:31:21 +0800 Subject: [PATCH] fix dump_login_status to wrong file. (#349) Changing auto_login's statusStorageDir, then KeyboardInterrupt will dump status to default file path, not new path. --- itchat/components/register.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/itchat/components/register.py b/itchat/components/register.py index 86a37fcc..079d3191 100644 --- a/itchat/components/register.py +++ b/itchat/components/register.py @@ -23,6 +23,7 @@ def auto_login(self, hotReload=False, statusStorageDir='itchat.pkl', logger.info("You can't get access to internet or wechat domain, so exit.") sys.exit() self.useHotReload = hotReload + self.hotReloadDir = statusStorageDir if hotReload: if self.load_login_status(statusStorageDir, loginCallback=loginCallback, exitCallback=exitCallback): @@ -30,7 +31,6 @@ def auto_login(self, hotReload=False, statusStorageDir='itchat.pkl', self.login(enableCmdQR=enableCmdQR, picDir=picDir, qrCallback=qrCallback, loginCallback=loginCallback, exitCallback=exitCallback) self.dump_login_status(statusStorageDir) - self.hotReloadDir = statusStorageDir else: self.login(enableCmdQR=enableCmdQR, picDir=picDir, qrCallback=qrCallback, loginCallback=loginCallback, exitCallback=exitCallback)