Skip to content

Commit

Permalink
fix dump_login_status to wrong file. (littlecodersh#349)
Browse files Browse the repository at this point in the history
Changing auto_login's statusStorageDir, then
KeyboardInterrupt will dump status to default file path, not new path.
  • Loading branch information
up9cloud authored and littlecodersh committed May 9, 2017
1 parent f8c8c80 commit c8ef672
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion itchat/components/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ 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):
return
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)
Expand Down

0 comments on commit c8ef672

Please sign in to comment.