From 1f023214ab3c91aef32d85498fe6942738174b0a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 6 Nov 2020 18:56:53 +0000 Subject: [PATCH] Wrong file --- follow.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/follow.py b/follow.py index 84c7823d..9f61636e 100644 --- a/follow.py +++ b/follow.py @@ -205,10 +205,11 @@ def unfollowPerson(baseDir: str, nickname: str, domain: str, return with open(filename, "r") as f: lines = f.readlines() - with open(filename, 'w+') as f: - for line in lines: - if line.strip("\n").strip("\r").lower() != handleToUnfollowLower: - f.write(line) + with open(filename, 'w+') as f: + for line in lines: + if line.strip("\n").strip("\r").lower() != \ + handleToUnfollowLower: + f.write(line) # write to an unfollowed file so that if a follow accept # later arrives then it can be ignored @@ -216,7 +217,7 @@ def unfollowPerson(baseDir: str, nickname: str, domain: str, if os.path.isfile(unfollowedFilename): if handleToUnfollowLower not in \ open(unfollowedFilename).read().lower(): - with open(filename, "a+") as f: + with open(unfollowedFilename, "a+") as f: f.write(handleToUnfollow + '\n') else: with open(unfollowedFilename, "w+") as f: