mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2025-10-23 15:11:08 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user