[Python-checkins] r59666 - python/trunk/PCbuild/vs9to8.py

christian.heimes python-checkins at python.org
Wed Jan 2 19:28:33 CET 2008


Author: christian.heimes
Date: Wed Jan 2 19:28:32 2008
New Revision: 59666
Modified:
 python/trunk/PCbuild/vs9to8.py
Log:
Made vs9to8 Unix compatible
Modified: python/trunk/PCbuild/vs9to8.py
==============================================================================
--- python/trunk/PCbuild/vs9to8.py	(original)
+++ python/trunk/PCbuild/vs9to8.py	Wed Jan 2 19:28:32 2008
@@ -11,7 +11,7 @@
 destname = os.path.normpath(os.path.join(dest, name))
 print("%s -> %s" % (filename, destname))
 
- with open(filename, 'r') as fin:
+ with open(filename, 'rU') as fin:
 lines = fin.read()
 lines = lines.replace('Version="9,00"', 'Version="8.00"')
 lines = lines.replace('Version="9.00"', 'Version="8.00"')
@@ -22,8 +22,9 @@
 lines = lines.replace('..\\', '..\\..\\')
 lines = lines.replace('..\\..\\..\\..\\', '..\\..\\..\\')
 
- with open(destname, 'w') as fout:
+ with open(destname, 'wb') as fout:
+ lines = lines.replace("\n", "\r\n")
 fout.write(lines)
 
 if __name__ == "__main__":
- vs9to8(src=".", dest="..\PC\VS8.0")
+ vs9to8(src=".", dest="../PC/VS8.0")


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /