pep585 and pathlib updates

This commit is contained in:
OMEGARAZER
2023-01-25 22:23:59 -05:00
parent e96b167b71
commit cf5f7bfd16
14 changed files with 31 additions and 28 deletions

View File

@@ -103,6 +103,6 @@ class OAuth2TokenManager(praw.reddit.BaseTokenManager):
def post_refresh_callback(self, authorizer: praw.reddit.Authorizer):
self.config.set("DEFAULT", "user_token", authorizer.refresh_token)
with open(self.config_location, "w") as file:
with Path(self.config_location).open(mode="w") as file:
self.config.write(file, True)
logger.log(9, f"Written OAuth2 token from authoriser to {self.config_location}")