def scan_module(egg_dir, base, name, stubs):
filename = os.path.join(base, name)<EOL>if filename[:-<NUM_LIT:1>] in stubs:<EOL><INDENT>return True  <EOL><DEDENT>pkg = base[len(egg_dir) + <NUM_LIT:1>:].replace(os.sep, '<STR_LIT:.>')<EOL>module = pkg + (pkg and '<STR_LIT:.>' or '<STR_LIT>') + os.path.splitext(name)[<NUM_LIT:0>]<EOL>if sys.version_info < (<NUM_LIT:3>, <NUM_LIT:3>):<EOL><INDENT>skip = <NUM_LIT:8>  <EOL><DEDENT>else:<EOL><INDENT>skip = <NUM_LIT:12>  <EOL><DEDENT>f = open(filename, '<STR_LIT:rb>')<EOL>f.read(skip)<EOL>code = marshal.load(f)<EOL>f.close()<EOL>safe = True<EOL>symbols = dict.fromkeys(iter_symbols(code))<EOL>for bad in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>if bad in symbols:<EOL><INDENT>log.warn("<STR_LIT>", module, bad)<EOL>safe = False<EOL><DEDENT><DEDENT>if '<STR_LIT>' in symbols:<EOL><INDENT>for bad in [<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'<EOL>]:<EOL><INDENT>if bad in symbols:<EOL><INDENT>log.warn("<STR_LIT>", module, bad)<EOL>safe = False<EOL><DEDENT><DEDENT><DEDENT>if '<STR_LIT>' in symbols and '<STR_LIT:__main__>' in symbols and '<STR_LIT:.>' not in module:<EOL><INDENT>if sys.version[:<NUM_LIT:3>] == "<STR_LIT>":  <EOL><INDENT>log.warn("<STR_LIT>", module)<EOL>safe = False<EOL><DEDENT><DEDENT>return safe<EOL>
Check whether module possibly uses unsafe-for-zipfile stuff