fix: use more explicit import in config constructor
This commit is contained in:
parent
f5825e964c
commit
fd76766f56
|
@ -231,7 +231,7 @@ class WuttaConfig:
|
||||||
|
|
||||||
# configure main app DB if applicable, or disable usedb flag
|
# configure main app DB if applicable, or disable usedb flag
|
||||||
try:
|
try:
|
||||||
from .db import Session, get_engines
|
from wuttjamaican.db import Session, get_engines
|
||||||
except ImportError:
|
except ImportError:
|
||||||
if self.usedb:
|
if self.usedb:
|
||||||
log.warning("config created with `usedb = True`, but can't import "
|
log.warning("config created with `usedb = True`, but can't import "
|
||||||
|
|
|
@ -183,7 +183,7 @@ preferdb = true
|
||||||
orig_import = __import__
|
orig_import = __import__
|
||||||
|
|
||||||
def mock_import(name, *args, **kwargs):
|
def mock_import(name, *args, **kwargs):
|
||||||
if name == 'db':
|
if name == 'wuttjamaican.db':
|
||||||
raise ImportError
|
raise ImportError
|
||||||
return orig_import(name, *args, **kwargs)
|
return orig_import(name, *args, **kwargs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue