Skip to content

Commit

Permalink
Get a traceback when we load the database auth module
Browse files Browse the repository at this point in the history
  • Loading branch information
zenhack committed Dec 30, 2016
1 parent 852341a commit e78667f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions haas/config.py
Expand Up @@ -90,11 +90,17 @@ def load_extensions():
if not cfg.has_section('extensions'):
return
for name in cfg.options('extensions'):
if name == 'haas.ext.auth.database':
try:
raise Exception("Python won't give me a traceback without "
"raising an exception.")
except Exception:
import traceback
print('Loaded haas.ext.auth.database. traceback:')
traceback.print_exc(file=sys.stdout)
importlib.import_module(name)
logger.debug('Importing extension: %r', name)
for name in cfg.options('extensions'):
if hasattr(sys.modules[name], 'setup'):
logger.debug('Calling setup for extension: %r', name)
sys.modules[name].setup()


Expand Down

0 comments on commit e78667f

Please sign in to comment.