Skip to content

Commit 44731f2

Browse files
committedApr 28, 2017
[db_manager] Fix postgis plugins loading
Fix infinite recursion on load calls
1 parent cfe8dfe commit 44731f2

File tree

1 file changed

+6
-4
lines changed
  • python/plugins/db_manager/db_plugins/postgis/plugins

1 file changed

+6
-4
lines changed
 

‎python/plugins/db_manager/db_plugins/postgis/plugins/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@
2121
"""
2222

2323
import os
24+
from importlib import import_module
2425

2526
current_dir = os.path.dirname(__file__)
2627

2728

28-
def load(dbplugin, mainwindow):
29+
def load(db, mainwindow):
2930
for name in os.listdir(current_dir):
3031
if not os.path.isdir(os.path.join(current_dir, name)):
3132
continue
33+
if name in ('__pycache__'):
34+
continue
3235
try:
33-
exec(u"from .%s import load" % name)
36+
plugin_module = import_module('.'.join((__package__, name)))
3437
except ImportError:
3538
continue
36-
37-
load(dbplugin, mainwindow)
39+
plugin_module.load(db, mainwindow)

0 commit comments

Comments
 (0)
Please sign in to comment.