From 5626ec3a814d3ac346bc9323b100810e54a817f9 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 16 May 2023 11:30:18 +0100 Subject: [PATCH] allow to run on Python 3.10 --- intermine/webservice.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/intermine/webservice.py b/intermine/webservice.py index bee49f4b..d25616d7 100644 --- a/intermine/webservice.py +++ b/intermine/webservice.py @@ -4,16 +4,20 @@ from contextlib import closing import requests +import sys try: from urlparse import urlparse from UserDict import DictMixin from urllib import urlopen from urllib import urlencode -except ImportError: +except (ImportError, ModuleNotFoundError): from urllib.parse import urlparse from urllib.parse import urlencode - from collections import MutableMapping as DictMixin + if sys.version_info[:2] >= (3, 8): + from collections.abc import MutableMapping as DictMixin + else: + from collections import MutableMapping as DictMixin from urllib.request import urlopen try: