Delay import in case SQLAlchemy not installed
This commit is contained in:
parent
0c5b6a075b
commit
d73e107d67
|
@ -27,8 +27,6 @@ Database Configuration
|
||||||
import logging
|
import logging
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from wuttjamaican.db import get_engines as wutta_get_engines
|
|
||||||
|
|
||||||
from rattail.exceptions import SQLAlchemyNotInstalled
|
from rattail.exceptions import SQLAlchemyNotInstalled
|
||||||
from rattail.config import parse_list
|
from rattail.config import parse_list
|
||||||
|
|
||||||
|
@ -72,8 +70,10 @@ def get_engines(config, section='rattail.db'):
|
||||||
|
|
||||||
return engines
|
return engines
|
||||||
|
|
||||||
# but if config style is newer, use upstream logic
|
# but if config style is newer, use upstream logic.
|
||||||
return wutta_get_engines(config, section)
|
# nb. must not import this at module top in case sqlalchemy not installed
|
||||||
|
from wuttjamaican.db import get_engines
|
||||||
|
return get_engines(config, section)
|
||||||
|
|
||||||
|
|
||||||
# TODO: Deprecate/remove this.
|
# TODO: Deprecate/remove this.
|
||||||
|
|
Loading…
Reference in a new issue