diff --git a/commands.py b/commands.py index 61b2485..cc8f001 100644 --- a/commands.py +++ b/commands.py @@ -106,7 +106,7 @@ async def info_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> No f"{html_parser.hyperlink("»", f"http://{app.hostname}/media_assets/{post_data['media_asset']['id']}")}" ) m.append( - f"Source: {post_data['source'] if post_data['source'] is not "" else "🚫"}" + f"Source: {post_data['source'] if post_data['source'] != "" else "🚫"}" ) m.append(f"Rating: {format_rating(post_data['rating'])}") m.append( diff --git a/extensions.py b/extensions.py index 6081ab0..ddb8a62 100644 --- a/extensions.py +++ b/extensions.py @@ -6,14 +6,14 @@ from config import app def humanize_tags_from_json(value: str, default: str) -> str: - if value is not "": + if value != "": return ", ".join([re.sub("_\\(.*", "", t) for t in value.split()]) return default def humanize_filesize(value: int) -> str: for unit in ["B", "KiB", "MiB", "GiB"]: - if value < 1024 or unit is "GiB": + if value < 1024 or unit == "GiB": break value /= 1024 return f"{value:.2f} {unit}" diff --git a/main.py b/main.py index 515ca85..2cf568d 100644 --- a/main.py +++ b/main.py @@ -35,7 +35,7 @@ def get_token() -> str: if os.getenv("BOT_TOKEN") is not None: return os.getenv("BOT_TOKEN") - if general.token is not "": + if general.token != "": return general.token print(