From 35b7b39b86c76cd2583377f49ab1f0939258d3e6 Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Sun, 23 Mar 2014 20:59:35 +0000 Subject: [PATCH] Don't choke when the version string server fails. git-svn-id: http://comictagger.googlecode.com/svn/trunk@683 6c5673fe-1810-88d6-992b-cd32ca31540c --- comictaggerlib/versionchecker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/comictaggerlib/versionchecker.py b/comictaggerlib/versionchecker.py index a8044db..51f1d00 100644 --- a/comictaggerlib/versionchecker.py +++ b/comictaggerlib/versionchecker.py @@ -24,7 +24,7 @@ import urllib,urllib2 import ctversion try: - from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest + from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply from PyQt4.QtCore import QUrl, pyqtSignal, QObject, QByteArray except ImportError: # No Qt, so define a few dummy QObjects to help us compile @@ -82,6 +82,9 @@ class VersionChecker(QObject): self.nam.get(QNetworkRequest(QUrl(str(url)))) def asyncGetLatestVersionComplete( self, reply ): + if (reply.error() != QNetworkReply.NoError): + return + # read in the response new_version = str(reply.readAll())