source: packages/lang/python/patches/040-dont-import-cross-compiled-modules.patch @ 29369

Last change on this file since 29369 was 29369, checked in by jow, 5 years ago

[packages] python: fix compilation against Linux 3.x (#10197)

File size: 1.7 KB
  • setup.py

    ---
     setup.py |   30 ------------------------------
     1 file changed, 30 deletions(-)
    
    a b class PyBuildExt(build_ext): 
    270270        ext_filename = os.path.join( 
    271271            self.build_lib, 
    272272            self.get_ext_filename(self.get_ext_fullname(ext.name))) 
    273         try: 
    274             imp.load_dynamic(ext.name, ext_filename) 
    275         except ImportError, why: 
    276             self.failed.append(ext.name) 
    277             self.announce('*** WARNING: renaming "%s" since importing it' 
    278                           ' failed: %s' % (ext.name, why), level=3) 
    279             assert not self.inplace 
    280             basename, tail = os.path.splitext(ext_filename) 
    281             newname = basename + "_failed" + tail 
    282             if os.path.exists(newname): 
    283                 os.remove(newname) 
    284             os.rename(ext_filename, newname) 
    285  
    286             # XXX -- This relies on a Vile HACK in 
    287             # distutils.command.build_ext.build_extension().  The 
    288             # _built_objects attribute is stored there strictly for 
    289             # use here. 
    290             # If there is a failure, _built_objects may not be there, 
    291             # so catch the AttributeError and move on. 
    292             try: 
    293                 for filename in self._built_objects: 
    294                     os.remove(filename) 
    295             except AttributeError: 
    296                 self.announce('unable to remove files (ignored)') 
    297         except: 
    298             exc_type, why, tb = sys.exc_info() 
    299             self.announce('*** WARNING: importing extension "%s" ' 
    300                           'failed with %s: %s' % (ext.name, exc_type, why), 
    301                           level=3) 
    302             self.failed.append(ext.name) 
    303273 
    304274    def get_platform(self): 
    305275        # Get value of sys.platform 
Note: See TracBrowser for help on using the repository browser.