Skip to content

Commit 036646f

Browse files
committedSep 27, 2017
Fix Object Inspector in Python console editor
1 parent 43a9bc1 commit 036646f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎python/console/console_editor.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import traceback
3535
import codecs
3636
import re
37+
import importlib
3738

3839

3940
class KeyFilter(QObject):
@@ -520,7 +521,7 @@ def _runSubProcess(self, filename, tmp=False):
520521
if dir not in sys.path:
521522
sys.path.append(dir)
522523
if name in sys.modules:
523-
reload(sys.modules[name]) # NOQA
524+
importlib.reload(sys.modules[name]) # NOQA
524525
try:
525526
# set creationflags for running command without shell window
526527
if sys.platform.startswith('win'):
@@ -1174,7 +1175,7 @@ def listObject(self, tab):
11741175
sys.path.append(pathFile)
11751176
found = True
11761177
try:
1177-
reload(pyclbr) # NOQA
1178+
importlib.reload(pyclbr) # NOQA
11781179
dictObject = {}
11791180
readModule = pyclbr.readmodule(module)
11801181
readModuleFunction = pyclbr.readmodule_ex(module)
@@ -1236,10 +1237,10 @@ def listObject(self, tab):
12361237
iconWarning = QgsApplication.getThemeIcon("console/iconSyntaxErrorConsole.png")
12371238
msgItem.setIcon(0, iconWarning)
12381239
self.parent.listClassMethod.addTopLevelItem(msgItem)
1239-
# s = traceback.format_exc()
1240-
# print '## Error: '
1241-
# sys.stderr.write(s)
1242-
# pass
1240+
# s = traceback.format_exc()
1241+
# print('## Error: ')
1242+
# sys.stderr.write(s)
1243+
# pass
12431244

12441245
def refreshSettingsEditor(self):
12451246
countTab = self.count()

0 commit comments

Comments
 (0)
Please sign in to comment.