def find_dependend_dlls(self, dlls, pypath, dll_excludes):
        import py2exe_util
        sysdir = py2exe_util.get_sysdir()
        windir = py2exe_util.get_windir()
        # This is the tail of the path windows uses when looking for dlls
        # XXX On Windows NT, the SYSTEM directory is also searched
        exedir = os.path.dirname(sys.executable)
        syspath = os.environ['PATH']
        loadpath = ';'.join([exedir, sysdir, windir, syspath])

        # Found by Duncan Booth:
        # It may be possible that bin_depends needs extension modules,
        # so the loadpath must be extended by our python path.
        loadpath = loadpath + ';' + ';'.join(pypath)

        templates = sets.Set()
        if self.distribution.console:
            templates.add(self.get_console_template())
        if self.distribution.windows:
            templates.add(self.get_windows_template())
        if self.distribution.service:
            templates.add(self.get_service_template())
        for target in self.distribution.com_server:
            if getattr(target, "create_exe", True):
                templates.add(self.get_comexe_template())
            if getattr(target, "create_dll", True):
                templates.add(self.get_comdll_template())

        templates = [os.path.join(os.path.dirname(__file__), t) for t in templates]

        # We use Python.exe to track the dependencies of our run stubs ...
        images = dlls + templates

        self.announce("Resolving binary dependencies:")
        excludes_use = dll_excludes[:]
        # The MSVCRT modules are never found when using VS2008+
        if sys.version_info > (2,6):
            excludes_use.append("msvcr90.dll")

        # we add python.exe (aka sys.executable) to the list of images
        # to scan for dependencies, but remove it later again from the
        # results list.  In this way pythonXY.dll is collected, and
        # also the libraries it depends on.
        alldlls, warnings, other_depends = \
                 bin_depends(loadpath, images + [sys.executable], excludes_use)
        alldlls.remove(sys.executable)
        for dll in alldlls:
            self.announce("  %s" % dll)
        # ... but we don't need the exe stubs run_xxx.exe
        for t in templates:
            alldlls.remove(t)

        return alldlls, warnings, other_depends
    # find_dependend_dlls()
dataset/ETHPy150Open fogleman/FeedNotifier/patch/build_exe.py/py2exe.find_dependend_dlls/original