Commits

jaraco  committed a1fbbbb

backport of r2225 from trunk (fixes #882 - data files incorrectly placed in windows binary distro)

  • Participants
  • Parent commits 1bc0e7f
  • Branches cherrypy-3.1.x

Comments (0)

Files changed (1)

 # end arguments for setup
 ###############################################################################
 
+def fix_data_files(data_files):
+    """
+    bdist_wininst seems to have a bug about where it installs data files.
+    I found a fix the django team used to work around the problem at
+    http://code.djangoproject.com/changeset/8313 .  This function
+    re-implements that solution.
+    Also see http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html
+    for more info.
+    """
+    def fix_dest_path(path):
+        return '\\PURELIB\\%(path)s' % vars()
+    
+    if not 'bdist_wininst' in sys.argv: return
+    
+    data_files[:] = [
+        (fix_dest_path(path), files)
+        for path, files in data_files]
+fix_data_files(data_files)
 
 def main():
     if sys.version < required_python_version: