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,
|
FloodWait,
|
||||||
MessageTooLong,
|
MessageTooLong,
|
||||||
PeerIdInvalid,
|
PeerIdInvalid,
|
||||||
ReactionInvalid,
|
)
|
||||||
)
|
|
||||||
from pyrogram.raw.types import UpdateBotStopped
|
from pyrogram.raw.types import UpdateBotStopped
|
||||||
from pyrogram.types import (
|
from pyrogram.types import (
|
||||||
InlineKeyboardButton,
|
InlineKeyboardButton,
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
* @projectName MissKatyPyro
|
* @projectName MissKatyPyro
|
||||||
* Copyright @YasirPedia All rights reserved
|
* Copyright @YasirPedia All rights reserved
|
||||||
"""
|
"""
|
||||||
|
import ast
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|
@ -66,7 +67,6 @@ __HELP__ = """
|
||||||
|
|
||||||
def remove_html_tags(text):
|
def remove_html_tags(text):
|
||||||
"""Remove html tags from a string"""
|
"""Remove html tags from a string"""
|
||||||
import re
|
|
||||||
|
|
||||||
clean = re.compile("<.*?>")
|
clean = re.compile("<.*?>")
|
||||||
return re.sub(clean, "", text)
|
return re.sub(clean, "", text)
|
||||||
|
|
@ -74,11 +74,11 @@ def remove_html_tags(text):
|
||||||
|
|
||||||
def calcExpression(text):
|
def calcExpression(text):
|
||||||
try:
|
try:
|
||||||
return float(eval(text))
|
return float(ast.literal_eval(text))
|
||||||
except (SyntaxError, ZeroDivisionError):
|
except (SyntaxError, ZeroDivisionError):
|
||||||
return ""
|
return ""
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return float(eval(text.replace("(", "*(")))
|
return float(ast.literal_eval(text.replace("(", "*(")))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOGGER.error(e, exc_info=True)
|
LOGGER.error(e, exc_info=True)
|
||||||
return ""
|
return ""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue