From 521cd9b1c25d88162f377bb05c8aadb70df028d7 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 17 Sep 2022 21:28:17 +0100 Subject: move subprocess.Popen.communicate at the end of the data stream --- src/backend/resolveDeps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/resolveDeps.py') diff --git a/src/backend/resolveDeps.py b/src/backend/resolveDeps.py index f0af4c0..580bfd4 100644 --- a/src/backend/resolveDeps.py +++ b/src/backend/resolveDeps.py @@ -10,7 +10,6 @@ def package(pkgname): areSources = [] needsConfig = int() portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n'] + list(pkgname), stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, stderr = portageExec.communicate() for portageOutput in io.TextIOWrapper(portageExec.stderr, encoding="utf-8"): if "The following keyword changes are necessary to proceed:" in portageOutput.rstrip(): @@ -34,6 +33,7 @@ def package(pkgname): isSource = str(portageOutput.rstrip().split("]")[1].split("[")[0].strip("\ ")) areSources.append(isSource) + stdout, stderr = portageExec.communicate() return areBinaries,areSources,needsConfig @animation.wait('resolving dependencies') @@ -42,7 +42,6 @@ def world(): areSources = [] needsConfig = int() portageExec = subprocess.Popen(['emerge', '--quiet', '--update', '--deep', '--newuse', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, stderr = portageExec.communicate() for portageOutput in io.TextIOWrapper(portageExec.stderr, encoding="utf-8"): if "The following keyword changes are necessary to proceed:" in portageOutput.rstrip(): @@ -66,4 +65,5 @@ def world(): isSource = str(portageOutput.rstrip().split("]")[1].split("[")[0].strip("\ ")) areSources.append(isSource) + stdout, stderr = portageExec.communicate() return areBinaries,areSources,needsConfig -- cgit v1.2.3