From 44eacde556aac2421b9e87bf2f8701d6ff0cf71f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 23 Nov 2020 14:26:20 +0000 Subject: [PATCH] Checking that petname exists --- petnames.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/petnames.py b/petnames.py index 7046a5d9..305f1d59 100644 --- a/petnames.py +++ b/petnames.py @@ -29,7 +29,7 @@ def setPetName(baseDir: str, nickname: str, domain: str, if os.path.isfile(petnamesFilename): with open(petnamesFilename, 'r') as petnamesFile: petnamesStr = petnamesFile.read() - if entry in petnamesStr: + if petnamesStr.startswith(petname + ' '): return True if ' ' + handle + '\n' in petnamesStr: petnamesList = petnamesStr.split('\n')