From 441196f360e8ef6650ae6b636eb70190984682cc Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 16 Oct 2015 23:59:39 +0200 Subject: [PATCH] Fixes #1470 --- lib/core/update.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/core/update.py b/lib/core/update.py index 7e0b802a7..3e0b38dd8 100644 --- a/lib/core/update.py +++ b/lib/core/update.py @@ -13,6 +13,7 @@ from subprocess import PIPE from subprocess import Popen as execute from lib.core.common import dataToStdout +from lib.core.common import getSafeExString from lib.core.common import pollProcess from lib.core.data import conf from lib.core.data import logger @@ -41,10 +42,15 @@ def update(): logger.debug(debugMsg) dataToStdout("\r[%s] [INFO] update in progress " % time.strftime("%X")) - process = execute("git checkout . && git pull %s HEAD" % GIT_REPOSITORY, shell=True, stdout=PIPE, stderr=PIPE) - pollProcess(process, True) - stdout, stderr = process.communicate() - success = not process.returncode + + try: + process = execute("git checkout . && git pull %s HEAD" % GIT_REPOSITORY, shell=True, stdout=PIPE, stderr=PIPE) + pollProcess(process, True) + stdout, stderr = process.communicate() + success = not process.returncode + except (IOError, OSError), ex: + success = False + stderr = getSafeExString(ex) if success: import lib.core.settings