PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` # -*- coding: utf-8 -*- """ Compatibility utilities for supporting multiple Python versions. This module provides utilities and workarounds to ensure compatibility across Python 3.5 through Python 3.12, with special attention to Windows-specific issues. """ import sys import platform import asyncio # Python version checks PY35 = sys.version_info[:2] == (3, 5) PY36 = sys.version_info[:2] == (3, 6) PY37 = sys.version_info[:2] == (3, 7) PY38 = sys.version_info[:2] == (3, 8) PY38_PLUS = sys.version_info[:2] >= (3, 8) # Platform checks IS_WINDOWS = platform.system() == 'Windows' def setup_windows_event_loop(): """ Set up the appropriate event loop for Windows in Python 3.8+. Python 3.8 changed the default event loop on Windows from SelectorEventLoop to ProactorEventLoop. This can cause compatibility issues with some libraries. This function ensures we use the SelectorEventLoop for consistency. """ if IS_WINDOWS and PY38_PLUS: # Set Windows event loop policy to use SelectorEventLoop asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) def format_string(template, *args, **kwargs): """ Provide a consistent string formatting method across Python versions. This is a wrapper around str.format() to ensure consistent behavior and provide a migration path from f-strings for Python 3.5 compatibility. Args: template: The string template with {} placeholders *args: Positional arguments for formatting **kwargs: Keyword arguments for formatting Returns: Formatted string """ return template.format(*args, **kwargs)