# Get the module from the module table
module = sys.modules[modname]
# Check that the module has a "handler" top level function, which
# should create a new Handler object.
if not hasattr(module, 'handler'):
# Get the module from the module table
module = sys.modules[modname]
# Check that the module has a "handler" top level function, which
# should create a new Handler object.
if not hasattr(module, 'handler'):