mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Fix weird UTF-8 error
This commit is contained in:
parent
e6caec11ab
commit
d4cc075691
1 changed files with 4 additions and 1 deletions
|
@ -325,7 +325,10 @@ class Events(commands.Cog):
|
|||
lines = 0
|
||||
|
||||
for file in root_files:
|
||||
code = file.read_text()
|
||||
try:
|
||||
code = file.read_text()
|
||||
except (UnicodeDecodeError, IOError, SystemError):
|
||||
continue
|
||||
for line in code.splitlines():
|
||||
line = line.strip()
|
||||
if not line or line.startswith("#"):
|
||||
|
|
Loading…
Reference in a new issue