From 61fff84a9147b3ce91a4e2a533074f1f5b1e2b9f Mon Sep 17 00:00:00 2001 From: cooler <52409646+notcooler@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:10:43 +0200 Subject: [PATCH] Update subreddit.py --- reddit/subreddit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reddit/subreddit.py b/reddit/subreddit.py index c871222..11b93af 100644 --- a/reddit/subreddit.py +++ b/reddit/subreddit.py @@ -41,8 +41,9 @@ def get_subreddit_threads(POST_ID: str): check_for_async=False, ) except ResponseException as e: - # match wasnt supported for python 3.9+ or above. So fixed it with a simple if stament. - if(e.response.status_code == 401): print("Invalid credentials - please check them in config.toml") + match e.response.status_code: + case 401: + print("Invalid credentials - please check them in config.toml") except: print("Something went wrong...")