commit:     9f0937f9f92496fa16a25e1ab8de1274bdcf1c71
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Sat Nov 22 16:49:29 2025 +0000
Commit:     Brian Harring <ferringb <AT> gmail <DOT> com>
CommitDate: Sat Nov 22 18:19:28 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=9f0937f9

chore: correct context protocol usage.

The returned obj from __enter__ is what has to
be used in a context, not the class/func/whatever invoked
to get it.

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>

 src/pkgcheck/scripts/pkgcheck_scan.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pkgcheck/scripts/pkgcheck_scan.py 
b/src/pkgcheck/scripts/pkgcheck_scan.py
index 7e554aab..d25a83de 100644
--- a/src/pkgcheck/scripts/pkgcheck_scan.py
+++ b/src/pkgcheck/scripts/pkgcheck_scan.py
@@ -518,8 +518,8 @@ def _determine_restrictions(namespace, attr):
 @scan.bind_main_func
 def _scan(options, out, err):
     with ExitStack() as stack:
-        reporter = options.reporter(out)
-        for c in options.pop("contexts") + [reporter]:
+        reporter = stack.enter_context(options.reporter(out))
+        for c in options.pop("contexts"):
             stack.enter_context(c)
         pipe = Pipeline(options)
         for result in pipe:

Reply via email to