Ticket #4500: trac-4500.patch

File trac-4500.patch, 1.3 KB (added by craigcitro, 13 years ago)
  • setup.py

    # HG changeset patch
    # User Craig Citro <craigcitro@gmail.com>
    # Date 1226575144 28800
    # Node ID 1d672544beab37ccff35b6dc506f976554698773
    # Parent  b72ec4b2800eb201c01d72537706e384faaa7950
    Fix trac #4500.
    
    diff -r b72ec4b2800e -r 1d672544beab setup.py
    a b  
    14731473    if f.endswith('.pyx'):
    14741474        # process cython file
    14751475        pyx_inst_file = '%s/%s'%(SITE_PACKAGES, f)
     1476        retval = os.system('cp %s %s 2>/dev/null'%(f, pyx_inst_file))
     1477        # we could do this more elegantly -- load the files, use
     1478        # os.path.exists to check that they exist, etc. ... but the
     1479        # *vast* majority of the time, the copy just works. so this is
     1480        # just specializing for the most common use case.
     1481        if retval:
     1482            dirname, filename = os.path.split(pyx_inst_file)
     1483            if not os.path.exists(dirname):
     1484                os.makedirs(dirname)
     1485            retval = os.system('cp %s %s 2>/dev/null'%(f, pyx_inst_file))
     1486            if retval:
     1487                raise OSError, "cannot copy %s to %s"%(f,pyx_inst_file)
    14761488        print "%s --> %s"%(f, pyx_inst_file)
    1477         os.system('cp %s %s 2>/dev/null'%(f, pyx_inst_file))
    14781489        outfile = f[:-4]
    14791490        if m.language == 'c++':
    14801491            outfile += ".cpp"