Catch BaseException to cope with KeyboardInterrupt and suchlike.

Django's module autoreloader calls sys.exit(), we want to catch that.
pull/35/head
David Wilson 9 years ago
parent 965350757f
commit 81dd265c20

@ -856,7 +856,7 @@ class ExternalContext(object):
self.broker.register(self.context) self.broker.register(self.context)
self._dispatch_calls() self._dispatch_calls()
LOG.debug('ExternalContext.main() normal exit') LOG.debug('ExternalContext.main() normal exit')
except Exception: except BaseException:
LOG.exception('ExternalContext.main() crashed') LOG.exception('ExternalContext.main() crashed')
raise raise
finally: finally:

@ -156,8 +156,9 @@ class ModuleResponder(object):
pkg_path = os.path.dirname(pkg.__file__) pkg_path = os.path.dirname(pkg.__file__)
try: try:
fp, path, ext = imp.find_module(modname, [pkg_path]) fp, path, ext = imp.find_module(modname, [pkg_path])
LOG.error('%r', (fp, path, ext))
return path, fp.read(), False return path, fp.read(), False
except ImportError: except ImportError, e:
LOG.debug('imp.find_module(%r, %r) -> %s', modname, [pkg_path], e) LOG.debug('imp.find_module(%r, %r) -> %s', modname, [pkg_path], e)
get_module_methods = [_get_module_via_pkgutil, get_module_methods = [_get_module_via_pkgutil,

Loading…
Cancel
Save