From 5a0461aab65bad05321d679f17cc059bba9d159b Mon Sep 17 00:00:00 2001 From: Ahmed TAHRI Date: Fri, 3 Jan 2025 15:56:45 +0100 Subject: [PATCH] :sparkle: add gil state in niquests.help summary --- src/niquests/help.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/niquests/help.py b/src/niquests/help.py index a262d2d823..75af6af029 100644 --- a/src/niquests/help.py +++ b/src/niquests/help.py @@ -58,6 +58,11 @@ wsproto = None # type: ignore +_IS_GIL_DISABLED: bool = ( + hasattr(sys, "_is_gil_enabled") and sys._is_gil_enabled() is False +) + + def _implementation(): """Return a dict with the Python implementation and version. @@ -132,6 +137,7 @@ def info(): "platform": platform_info, "implementation": implementation_info, "system_ssl": system_ssl_info, + "gil": not _IS_GIL_DISABLED, "urllib3.future": urllib3_info, "charset_normalizer": charset_normalizer_info, "idna": idna_info, @@ -209,8 +215,8 @@ def main() -> None: if __legacy_urllib3_version__ is not None: warnings.warn( - "urllib3-future is installed alongside (legacy) urllib3. This may cause compatibility issues." - "Some (Requests) 3rd parties may be bound to urllib3, therefor the plugins may wrongfully invoke" + "urllib3-future is installed alongside (legacy) urllib3. This may cause compatibility issues. " + "Some (Requests) 3rd parties may be bound to urllib3, therefor the plugins may wrongfully invoke " "urllib3 (legacy) instead of urllib3-future. To remediate this, run " "`python -m pip uninstall -y urllib3 urllib3-future`, then run `python -m pip install urllib3-future`.", UserWarning,