setup.py
changeset 32251 a04f5c651e52
parent 32233 feb910d2f59b
child 32367 a9c71d578a1c
equal deleted inserted replaced
32250:8a137ef6e5da 32251:a04f5c651e52
   370                                  'Mercurial but weren\'t found in %s' % h)
   370                                  'Mercurial but weren\'t found in %s' % h)
   371 
   371 
   372     def run(self):
   372     def run(self):
   373         if self.distribution.pure:
   373         if self.distribution.pure:
   374             modulepolicy = 'py'
   374             modulepolicy = 'py'
       
   375         elif self.build_lib == '.':
       
   376             # in-place build should run without rebuilding C extensions
       
   377             modulepolicy = 'allow'
   375         else:
   378         else:
   376             modulepolicy = 'c'
   379             modulepolicy = 'c'
   377         with open("mercurial/__modulepolicy__.py", "w") as f:
   380         with open("mercurial/__modulepolicy__.py", "w") as f:
   378             f.write('# this file is autogenerated by setup.py\n')
   381             f.write('# this file is autogenerated by setup.py\n')
   379             f.write('modulepolicy = b"%s"\n' % modulepolicy)
   382             f.write('modulepolicy = b"%s"\n' % modulepolicy)