def add_versioninfo(self, target, exe_path):
        # Try to build and add a versioninfo resource

        def get(name, md = self.distribution.metadata):
            # Try to get an attribute from the target, if not defined
            # there, from the distribution's metadata, or None.  Note
            # that only *some* attributes are allowed by distutils on
            # the distribution's metadata: version, description, and
            # name.
            return getattr(target, name, getattr(md, name, None))

        version = get("version")
        if version is None:
            return

        from py2exe.resources.VersionInfo import Version, RT_VERSION, VersionError
        version = Version(version,
                          file_description = get("description"),
                          comments = get("comments"),
                          company_name = get("company_name"),
                          legal_copyright = get("copyright"),
                          legal_trademarks = get("trademarks"),
                          original_filename = os.path.basename(exe_path),
                          product_name = get("name"),
                          product_version = get("product_version") or version)
        try:
            bytes = version.resource_bytes()
        except VersionError, detail:
            self.warn("Version Info will not be included:\n  %s" % detail)
            return

        from py2exe_util import add_resource
        add_resource(ensure_unicode(exe_path), bytes, RT_VERSION, 1, False)
dataset/ETHPy150Open fogleman/FeedNotifier/patch/build_exe.py/py2exe.add_versioninfo/original