summaryrefslogtreecommitdiff
path: root/src/python/m5/stats
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/m5/stats')
-rw-r--r--src/python/m5/stats/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/python/m5/stats/__init__.py b/src/python/m5/stats/__init__.py
index acb62f13e..019c7ebb8 100644
--- a/src/python/m5/stats/__init__.py
+++ b/src/python/m5/stats/__init__.py
@@ -71,7 +71,11 @@ def _url_factory(func):
@wraps(func)
def wrapper(url):
- from urlparse import parse_qs
+ try:
+ from urllib.parse import parse_qs
+ except ImportError:
+ # Python 2 fallback
+ from urlparse import parse_qs
from ast import literal_eval
qs = parse_qs(url.query, keep_blank_values=True)
@@ -135,7 +139,11 @@ def addStatVisitor(url):
"""
- from urlparse import urlsplit
+ try:
+ from urllib.parse import urlsplit
+ except ImportError:
+ # Python 2 fallback
+ from urlparse import urlsplit
parsed = urlsplit(url)