fix: suppress tinycss SyntaxWarning by initializing filter before imports

Move warnings.filterwarnings() to the very top of __main__.py before any
other imports to ensure it takes effect before tinycss is loaded during
module discovery. This fixes the SyntaxWarning from the unmaintained
tinycss package (a dependency of subby).

refs #20
This commit is contained in:
Sp5rky
2025-09-30 13:55:21 -06:00
parent ebe5012aeb
commit 2d5e807e7d

View File

@@ -1,14 +1,16 @@
import warnings
# Suppress SyntaxWarning from unmaintained tinycss package (dependency of subby)
# Must be set before any imports that might trigger tinycss loading
warnings.filterwarnings("ignore", category=SyntaxWarning, module="tinycss")
import atexit
import logging
import warnings
from pathlib import Path
import click
import urllib3
from rich import traceback
# Suppress SyntaxWarning from unmaintained tinycss package (dependency of subby)
warnings.filterwarnings("ignore", category=SyntaxWarning, module="tinycss")
from rich.console import Group
from rich.padding import Padding
from rich.text import Text