Unfold some lines that were previously folded but don't need to be
now we're reindented. Remove files before renaming something to them -- for Windows. Change check for Python home directory so it works correct on Windows.
This commit is contained in:
parent
541e783664
commit
e0394259b0
|
@ -145,7 +145,7 @@ def main():
|
||||||
prefix = sys.prefix
|
prefix = sys.prefix
|
||||||
|
|
||||||
# determine whether -p points to the Python source tree
|
# determine whether -p points to the Python source tree
|
||||||
ishome = os.path.exists(os.path.join(prefix, 'Include', 'pythonrun.h'))
|
ishome = os.path.exists(os.path.join(prefix, 'Python', 'ceval.c'))
|
||||||
|
|
||||||
# locations derived from options
|
# locations derived from options
|
||||||
version = sys.version[:3]
|
version = sys.version[:3]
|
||||||
|
@ -275,8 +275,8 @@ def main():
|
||||||
outfp.close()
|
outfp.close()
|
||||||
if backup:
|
if backup:
|
||||||
if cmp.cmp(backup, frozen_c):
|
if cmp.cmp(backup, frozen_c):
|
||||||
sys.stderr.write('%s not changed, not written\n' %
|
sys.stderr.write('%s not changed, not written\n' % frozen_c)
|
||||||
frozen_c)
|
os.unlink(frozen_c)
|
||||||
os.rename(backup, frozen_c)
|
os.rename(backup, frozen_c)
|
||||||
|
|
||||||
# windows gets different treatment
|
# windows gets different treatment
|
||||||
|
@ -332,8 +332,8 @@ def main():
|
||||||
infp.close()
|
infp.close()
|
||||||
if backup:
|
if backup:
|
||||||
if cmp.cmp(backup, config_c):
|
if cmp.cmp(backup, config_c):
|
||||||
sys.stderr.write('%s not changed, not written\n' %
|
sys.stderr.write('%s not changed, not written\n' % config_c)
|
||||||
config_c)
|
os.unlink(config_c)
|
||||||
os.rename(backup, config_c)
|
os.rename(backup, config_c)
|
||||||
|
|
||||||
cflags = defines + includes + ['$(OPT)']
|
cflags = defines + includes + ['$(OPT)']
|
||||||
|
@ -351,6 +351,11 @@ def main():
|
||||||
['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)']
|
['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)']
|
||||||
|
|
||||||
backup = makefile + '~'
|
backup = makefile + '~'
|
||||||
|
if os.path.exists(makefile):
|
||||||
|
try:
|
||||||
|
os.unlink(backup)
|
||||||
|
except os.error:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
os.rename(makefile, backup)
|
os.rename(makefile, backup)
|
||||||
except os.error:
|
except os.error:
|
||||||
|
@ -364,8 +369,8 @@ def main():
|
||||||
if not cmp.cmp(backup, makefile):
|
if not cmp.cmp(backup, makefile):
|
||||||
print 'previous Makefile saved as', backup
|
print 'previous Makefile saved as', backup
|
||||||
else:
|
else:
|
||||||
sys.stderr.write('%s not changed, not written\n' %
|
sys.stderr.write('%s not changed, not written\n' % makefile)
|
||||||
makefile)
|
os.unlink(makefile)
|
||||||
os.rename(backup, makefile)
|
os.rename(backup, makefile)
|
||||||
|
|
||||||
# Done!
|
# Done!
|
||||||
|
|
Loading…
Reference in New Issue