From 2c8d055ca4e9b92842615516834bb2472348b15e Mon Sep 17 00:00:00 2001 From: mmonkey Date: Mon, 4 Jan 2021 12:36:40 -0600 Subject: [PATCH] support python2.7 for the mean time --- cps/tasks/database.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cps/tasks/database.py b/cps/tasks/database.py index 62208c0c..11f0186d 100644 --- a/cps/tasks/database.py +++ b/cps/tasks/database.py @@ -20,7 +20,11 @@ from __future__ import division, print_function, unicode_literals from cps import config, logger from cps.services.worker import CalibreTask -from urllib.request import urlopen + +try: + from urllib.request import urlopen +except ImportError as e: + from urllib2 import urlopen class TaskReconnectDatabase(CalibreTask):