summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2019-03-15 00:09:10 +0100
committerStefan Behnel <stefan_ml@behnel.de>2019-03-15 00:09:10 +0100
commit68d0d5758f6635250bf2f90f2643e8d979286d14 (patch)
tree81b8f3b42334f7dc644ba88194a8db94a8c5711c
parent2673b1abf1acb6b8123c7fabdfe33a7c66661e8e (diff)
downloadcython-68d0d5758f6635250bf2f90f2643e8d979286d14.tar.gz
Fix some "resource usage" warnings for unclosed process pipes when running in a CPython debug build.
-rw-r--r--Cython/Build/Dependencies.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Cython/Build/Dependencies.py b/Cython/Build/Dependencies.py
index ac08f230e..00d407a96 100644
--- a/Cython/Build/Dependencies.py
+++ b/Cython/Build/Dependencies.py
@@ -1251,9 +1251,10 @@ def _init_multiprocessing_helper():
def cleanup_cache(cache, target_size, ratio=.85):
try:
p = subprocess.Popen(['du', '-s', '-k', os.path.abspath(cache)], stdout=subprocess.PIPE)
+ stdout, _ = p.communicate()
res = p.wait()
if res == 0:
- total_size = 1024 * int(p.stdout.read().strip().split()[0])
+ total_size = 1024 * int(stdout.strip().split()[0])
if total_size < target_size:
return
except (OSError, ValueError):