forked from qt-creator/qt-creator
Debugger: Reduce scope of usage of Python's importlib module
The module doesn't exist in Python 2.6, so we can't use it unconditionally if 2.6 is to be supported again. Task-number: QTCREATORBUG-15076 Change-Id: Ic91cdf451ce846d892cd914bf850a4fd4b18c488 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -34,7 +34,6 @@ import sys
|
||||
import base64
|
||||
import re
|
||||
import time
|
||||
import importlib
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
xrange = range
|
||||
@@ -1690,7 +1689,7 @@ class DumperBase:
|
||||
self.resetCaches()
|
||||
|
||||
for mod in self.dumpermodules:
|
||||
m = importlib.import_module(mod)
|
||||
m = __import__(mod)
|
||||
dic = m.__dict__
|
||||
for name in dic.keys():
|
||||
item = dic[name]
|
||||
@@ -1708,6 +1707,7 @@ class DumperBase:
|
||||
for mod in self.dumpermodules:
|
||||
m = sys.modules[mod]
|
||||
if sys.version_info[0] >= 3:
|
||||
import importlib
|
||||
importlib.reload(m)
|
||||
else:
|
||||
reload(m)
|
||||
|
Reference in New Issue
Block a user