mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
refactor: autofix issues in 2 files
Resolved issues in the following files with DeepSource Autofix: 1. misskaty/plugins/dev.py 2. misskaty/plugins/misc_tools.py
This commit is contained in:
parent
5d66d52255
commit
58d2f1ad36
2 changed files with 4 additions and 5 deletions
|
|
@ -34,8 +34,7 @@ from pyrogram.errors import (
|
|||
FloodWait,
|
||||
MessageTooLong,
|
||||
PeerIdInvalid,
|
||||
ReactionInvalid,
|
||||
)
|
||||
)
|
||||
from pyrogram.raw.types import UpdateBotStopped
|
||||
from pyrogram.types import (
|
||||
InlineKeyboardButton,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* @projectName MissKatyPyro
|
||||
* Copyright @YasirPedia All rights reserved
|
||||
"""
|
||||
import ast
|
||||
|
||||
import asyncio
|
||||
import contextlib
|
||||
|
|
@ -66,7 +67,6 @@ __HELP__ = """
|
|||
|
||||
def remove_html_tags(text):
|
||||
"""Remove html tags from a string"""
|
||||
import re
|
||||
|
||||
clean = re.compile("<.*?>")
|
||||
return re.sub(clean, "", text)
|
||||
|
|
@ -74,11 +74,11 @@ def remove_html_tags(text):
|
|||
|
||||
def calcExpression(text):
|
||||
try:
|
||||
return float(eval(text))
|
||||
return float(ast.literal_eval(text))
|
||||
except (SyntaxError, ZeroDivisionError):
|
||||
return ""
|
||||
except TypeError:
|
||||
return float(eval(text.replace("(", "*(")))
|
||||
return float(ast.literal_eval(text.replace("(", "*(")))
|
||||
except Exception as e:
|
||||
LOGGER.error(e, exc_info=True)
|
||||
return ""
|
||||
|
|
|
|||
Loading…
Reference in a new issue