From 6eb2c1218d76380866841b19adbf1ff685d4317b Mon Sep 17 00:00:00 2001 From: Dominik Wild Date: Mon, 28 Mar 2016 20:34:21 +0200 Subject: [PATCH] catch urllib2.URLError when downloading media --- Memrise_Course_Importer/importer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Memrise_Course_Importer/importer.py b/Memrise_Course_Importer/importer.py index 82920bd..81d6556 100644 --- a/Memrise_Course_Importer/importer.py +++ b/Memrise_Course_Importer/importer.py @@ -108,7 +108,7 @@ def download(self, url): while True: try: return self.memriseService.downloadMedia(url, skipExisting=self.skipExistingMedia) - except urllib2.HTTPError as e: + except (urllib2.HTTPError, urllib2.URLError) as e: if callable(self.askerFunction) and hasattr(self.askerFunction, '__self__'): action = QMetaObject.invokeMethod(self.askerFunction.__self__, self.askerFunction.__name__, Qt.BlockingQueuedConnection, Q_RETURN_ARG(str), Q_ARG(str, url), Q_ARG(str, str(e)), Q_ARG(str, url)) if action == "ignore":