[projects/git-slug: 18/170] Set buffer size for Popen
glen
glen at pld-linux.org
Mon Sep 21 21:40:19 CEST 2015
commit 73c5394ae7a297a994de3838b00c958f6da27936
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Wed Sep 14 17:58:07 2011 +0100
Set buffer size for Popen
It speeds up the code ~2x
pldrepo/gitrepo.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pldrepo/gitrepo.py b/pldrepo/gitrepo.py
index f552b44..c57a0a5 100644
--- a/pldrepo/gitrepo.py
+++ b/pldrepo/gitrepo.py
@@ -21,7 +21,7 @@ class GitRepo:
self.command_prefix.append('--work-tree='+self.wtree)
def command(self, clist):
- return subprocess.Popen(self.command_prefix + clist, stdout=PIPE, stderr=PIPE)
+ return subprocess.Popen(self.command_prefix + clist, stdout=PIPE, stderr=PIPE, bufsize=-1)
def commandio(self, clist):
return self.command(clist).communicate()
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5
More information about the pld-cvs-commit
mailing list