def get_module_constant(module, symbol, default=-<NUM_LIT:1>, paths=None):
try:<EOL><INDENT>f, path, (suffix, mode, kind) = find_module(module, paths)<EOL><DEDENT>except ImportError:<EOL><INDENT>return None<EOL><DEDENT>try:<EOL><INDENT>if kind==PY_COMPILED:<EOL><INDENT>f.read(<NUM_LIT:8>)   <EOL>code = marshal.load(f)<EOL><DEDENT>elif kind==PY_FROZEN:<EOL><INDENT>code = imp.get_frozen_object(module)<EOL><DEDENT>elif kind==PY_SOURCE:<EOL><INDENT>code = compile(f.read(), path, '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>if module not in sys.modules:<EOL><INDENT>imp.load_module(module, f, path, (suffix, mode, kind))<EOL><DEDENT>return getattr(sys.modules[module], symbol, None)<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>if f:<EOL><INDENT>f.close()<EOL><DEDENT><DEDENT>return extract_constant(code, symbol, default)<EOL>
Find 'module' by searching 'paths', and extract 'symbol'

    Return 'None' if 'module' does not exist on 'paths', or it does not define
    'symbol'.  If the module defines 'symbol' as a constant, return the
    constant.  Otherwise, return 'default'.