Mercurial > cpython-lru_cache-weakref
comparison PC/python33gen.py @ 68071:0f52cfc91fae
More automated version replacement.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sun, 20 Feb 2011 10:41:31 +0000 |
| parents | PC/python32gen.py@062907f685ac |
| children | eb5ed3da6862 |
comparison
equal
deleted
inserted
replaced
| 68070:203945060baf | 68071:0f52cfc91fae |
|---|---|
| 1 # Generate python33stub.def out of python3.def | |
| 2 # The regular import library cannot be used, | |
| 3 # since it doesn't provide the right symbols for | |
| 4 # data forwarding | |
| 5 out = open("python33stub.def", "w") | |
| 6 out.write('LIBRARY "python33"\n') | |
| 7 out.write('EXPORTS\n') | |
| 8 | |
| 9 inp = open("python3.def") | |
| 10 inp.readline() | |
| 11 line = inp.readline() | |
| 12 assert line.strip()=='EXPORTS' | |
| 13 | |
| 14 for line in inp: | |
| 15 # SYM1=python33.SYM2[ DATA] | |
| 16 head, tail = line.split('.') | |
| 17 if 'DATA' in tail: | |
| 18 symbol, tail = tail.split(' ') | |
| 19 else: | |
| 20 symbol = tail.strip() | |
| 21 out.write(symbol+'\n') | |
| 22 | |
| 23 inp.close() | |
| 24 out.close() | |
| 25 |
