From c4dce659a4be7cbfe2376586e09e6a9c3d316794 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 12 Mar 2009 15:43:04 +0100 Subject: [PATCH] Use Popen.communicate() to avoid hang (Sascha Silbe) #397 --- src/sugar/activity/bundlebuilder.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py index 71da0df7..90fac554 100644 --- a/src/sugar/activity/bundlebuilder.py +++ b/src/sugar/activity/bundlebuilder.py @@ -207,12 +207,13 @@ class SourcePackager(Packager): def get_files(self): git_ls = subprocess.Popen('git-ls-files', stdout=subprocess.PIPE, cwd=self.config.source_dir) - if git_ls.wait(): + stdout, _ = git_ls.communicate() + if git_ls.returncode : # Fall back to filtered list return list_files(self.config.source_dir, IGNORE_DIRS, IGNORE_FILES) - return [path.strip() for path in git_ls.stdout.readlines()] + return [path.strip() for path in '\n'.split(stdout)] def package(self): tar = tarfile.open(self.package_path, 'w:bz2')