Ticket #397: bundlebuilder-hangfix.patch

File bundlebuilder-hangfix.patch, 892 bytes (added by sascha_silbe, 15 years ago)

use Popen.communicate() to avoid hang

  • src/sugar/activity/bundlebuilder.py

    diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py
    index ab3679b..e638670 100644
    a b class SourcePackager(Packager): 
    207207    def get_files(self):
    208208        git_ls = subprocess.Popen('git-ls-files', stdout=subprocess.PIPE,
    209209                                  cwd=self.config.source_dir)
    210         if git_ls.wait():
     210        stdout, _ = git_ls.communicate()
     211        if git_ls.returncode :
    211212            # Fall back to filtered list
    212213            return list_files(self.config.source_dir,
    213214                              IGNORE_DIRS, IGNORE_FILES)
    214215       
    215         return [path.strip() for path in git_ls.stdout.readlines()]
     216        return [path.strip() for path in "\n".split(stdout)]
    216217
    217218    def package(self):
    218219        tar = tarfile.open(self.package_path, 'w:bz2')