Fix for #2299 (scholarly requires Internet connection at startup)

This commit is contained in:
Ozzie Isaacs
2022-01-31 18:09:23 +01:00
parent 42f8209a4a
commit 23e47ba4e6
3 changed files with 13 additions and 9 deletions

View File

@@ -16,7 +16,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from scholarly import scholarly
try:
from fake_useragent.errors import FakeUserAgentError
except (ImportError):
FakeUserAgentError = BaseException
try:
from scholarly import scholarly
except FakeUserAgentError:
raise ImportError("No module named 'scholarly'")
from cps.services.Metadata import Metadata