awacke1 commited on
Commit
a9bc037
·
verified ·
1 Parent(s): 1116e85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -200,7 +200,8 @@ async def load_votes(file):
200
  if not os.path.exists(file):
201
  await asyncio.to_thread(lambda: open(file, 'w').write("# Vote Tally\n\nNo votes yet - get clicking! 🖱️\n"))
202
  with open(file, 'r') as f:
203
- lines = await asyncio.to_thread(f.read.strip().split, '\n')[2:]
 
204
  votes = {}
205
  user_votes = set()
206
  for line in lines:
 
200
  if not os.path.exists(file):
201
  await asyncio.to_thread(lambda: open(file, 'w').write("# Vote Tally\n\nNo votes yet - get clicking! 🖱️\n"))
202
  with open(file, 'r') as f:
203
+ content = await asyncio.to_thread(f.read)
204
+ lines = content.strip().split('\n')[2:] # Process content after reading
205
  votes = {}
206
  user_votes = set()
207
  for line in lines: