##// END OF EJS Templates
setup: do not overwrite local __modulepolicy__.py on out-of-source build...
Yuya Nishihara -
r32653:7dab4c0c default
parent child Browse files
Show More
@@ -371,6 +371,9 b' class hgbuildpy(build_py):'
371 'Mercurial but weren\'t found in %s' % h)
371 'Mercurial but weren\'t found in %s' % h)
372
372
373 def run(self):
373 def run(self):
374 basepath = os.path.join(self.build_lib, 'mercurial')
375 self.mkpath(basepath)
376
374 if self.distribution.pure:
377 if self.distribution.pure:
375 modulepolicy = 'py'
378 modulepolicy = 'py'
376 elif self.build_lib == '.':
379 elif self.build_lib == '.':
@@ -378,7 +381,7 b' class hgbuildpy(build_py):'
378 modulepolicy = 'allow'
381 modulepolicy = 'allow'
379 else:
382 else:
380 modulepolicy = 'c'
383 modulepolicy = 'c'
381 with open("mercurial/__modulepolicy__.py", "w") as f:
384 with open(os.path.join(basepath, '__modulepolicy__.py'), "w") as f:
382 f.write('# this file is autogenerated by setup.py\n')
385 f.write('# this file is autogenerated by setup.py\n')
383 f.write('modulepolicy = b"%s"\n' % modulepolicy)
386 f.write('modulepolicy = b"%s"\n' % modulepolicy)
384
387
General Comments 0
You need to be logged in to leave comments. Login now