From b7dd2ea2aee7ecc21928d33405d31ad996a0e7e3 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Thu, 1 Oct 2009 00:51:39 -0500 Subject: bld2:increase the timeout when spawning external cmds. --- build_tools/bin/bld_resource.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build_tools/bin/bld_resource.py b/build_tools/bin/bld_resource.py index 30c5986..a972224 100755 --- a/build_tools/bin/bld_resource.py +++ b/build_tools/bin/bld_resource.py @@ -226,7 +226,7 @@ class MyThread(QtCore.QThread): try: logfile = "%s/%s.build.log" %(builddir,itemText) f = open(logfile, 'w') - child = pexpect.spawn(cmd,cwd=builddir) + child = pexpect.spawn(cmd,cwd=builddir,timeout=self.TIMEOUT) for line in child: f.write(line) self.emit(SIGNAL("update_build(QString)"),line) @@ -261,6 +261,7 @@ class MyThread(QtCore.QThread): self.mparglist = mparglist self.cmd_in = cmd_in self.running = 0 + self.TIMEOUT=300 self.start() def run(self): @@ -402,6 +403,7 @@ class run_cmd_thread(QtCore.QThread): def value_init(self,runcmd,args): self.runcmd = runcmd self.args = args + self.TIMEOUT=300 self.start() def run(self): @@ -416,7 +418,7 @@ class run_cmd_thread(QtCore.QThread): f = open(logfile, 'w') outText="log files is: %s" %logfile self.emit(SIGNAL("update(QString)"),outText) - child = pexpect.spawn(str(self.runcmd),self.args) + child = pexpect.spawn(str(self.runcmd),self.args,timeout=self.TIMEOUT) for line in child: f.write(line) self.emit(SIGNAL("update_build(QString)"),line) @@ -425,9 +427,10 @@ class run_cmd_thread(QtCore.QThread): retcode=child.exitstatus f.write(str(retcode)) f.close() - except: + except Exception, reason: line = "****Exception happened: %s" %self.runcmd self.emit(SIGNAL("update(QString)"),line) + self.emit(SIGNAL("update(QString)"),str(reason)) pass self.emit(SIGNAL("enable_tab2(bool)"),True) -- cgit v0.12