Ticket #3586: 3586.no-speedups.3.patch

File 3586.no-speedups.3.patch, 1.3 KB (added by techtonik, 3 years ago)

(removed unused build import)

  • twisted/python/dist.py

     
    1010from distutils.command import build_scripts, install_data, build_ext, build_py 
    1111from distutils.errors import CompileError 
    1212from distutils import core 
    13 from distutils.core import Extension 
     13from distutils.core import Extension, Distribution 
    1414 
    1515twisted_subprojects = ["conch", "lore", "mail", "names", 
    1616                       "news", "pair", "runner", "web", 
     
    253253 
    254254## Helpers and distutil tweaks 
    255255 
     256# Global --no-speedups option to install Twisted without extensions - #3586 
     257 
     258Distribution.global_options.append(('no-speedups', None, 'skip C extensions')) 
     259Distribution.no_speedups = 0 
     260 
     261 
    256262class build_py_twisted(build_py.build_py): 
    257263    """ 
    258264    Changes behavior in Python 2.2 to support simultaneous specification of 
     
    301307    Allow subclasses to easily detect and customize Extensions to 
    302308    build at install-time. 
    303309    """ 
     310    def finalize_options(self): 
     311        """ 
     312        Clean extension list if global --no-speedups option is set. 
     313        """ 
     314        build_ext.build_ext.finalize_options(self) 
     315        if self.distribution.no_speedups: 
     316            self.extensions = [] 
    304317 
    305318    def prepare_extensions(self): 
    306319        """