Skip to content
Permalink
Browse files
[db_manager] Fix postgis plugins loading
Fix infinite recursion on load calls
  • Loading branch information
arnaud-morvan committed Apr 28, 2017
1 parent cfe8dfe commit 44731f2314af786c0b5583e1f4119c8410407c2c
Showing with 6 additions and 4 deletions.
  1. +6 −4 python/plugins/db_manager/db_plugins/postgis/plugins/__init__.py
@@ -21,17 +21,19 @@
"""

import os
from importlib import import_module

current_dir = os.path.dirname(__file__)


def load(dbplugin, mainwindow):
def load(db, mainwindow):
for name in os.listdir(current_dir):
if not os.path.isdir(os.path.join(current_dir, name)):
continue
if name in ('__pycache__'):
continue
try:
exec(u"from .%s import load" % name)
plugin_module = import_module('.'.join((__package__, name)))
except ImportError:
continue

load(dbplugin, mainwindow)
plugin_module.load(db, mainwindow)

0 comments on commit 44731f2

Please sign in to comment.