Mercurial > cpython-lru_cache-weakref
annotate PC/python34gen.py @ 81343:3a7cd8efc19f
#16852: merge with 3.3.
| author | Ezio Melotti <ezio.melotti@gmail.com> |
|---|---|
| date | Thu, 10 Jan 2013 03:29:45 +0200 |
| parents | 1085b0e475d8 |
| children |
| rev | line source |
|---|---|
|
79240
1085b0e475d8
Bump version to 3.4.0 alpha 0.
Georg Brandl <georg@python.org>
parents:
77653
diff
changeset
|
1 # Generate python34stub.def out of python3.def |
| 68136 | 2 # The regular import library cannot be used, |
| 3 # since it doesn't provide the right symbols for | |
| 4 # data forwarding | |
|
79240
1085b0e475d8
Bump version to 3.4.0 alpha 0.
Georg Brandl <georg@python.org>
parents:
77653
diff
changeset
|
5 out = open("python34stub.def", "w") |
|
1085b0e475d8
Bump version to 3.4.0 alpha 0.
Georg Brandl <georg@python.org>
parents:
77653
diff
changeset
|
6 out.write('LIBRARY "python34"\n') |
| 68136 | 7 out.write('EXPORTS\n') |
| 8 | |
| 9 inp = open("python3.def") | |
| 10 line = inp.readline() | |
|
77653
3f14119e4af7
Issue #11626: Add _SizeT functions to stable ABI.
Martin v. Löwis <martin@v.loewis.de>
parents:
68258
diff
changeset
|
11 while line.strip().startswith(';'): |
|
3f14119e4af7
Issue #11626: Add _SizeT functions to stable ABI.
Martin v. Löwis <martin@v.loewis.de>
parents:
68258
diff
changeset
|
12 line = inp.readline() |
|
3f14119e4af7
Issue #11626: Add _SizeT functions to stable ABI.
Martin v. Löwis <martin@v.loewis.de>
parents:
68258
diff
changeset
|
13 line = inp.readline() # LIBRARY |
| 68136 | 14 assert line.strip()=='EXPORTS' |
| 15 | |
| 16 for line in inp: | |
|
79240
1085b0e475d8
Bump version to 3.4.0 alpha 0.
Georg Brandl <georg@python.org>
parents:
77653
diff
changeset
|
17 # SYM1=python34.SYM2[ DATA] |
| 68136 | 18 head, tail = line.split('.') |
| 19 if 'DATA' in tail: | |
| 20 symbol, tail = tail.split(' ') | |
| 21 else: | |
| 22 symbol = tail.strip() | |
| 23 out.write(symbol+'\n') | |
| 24 | |
| 25 inp.close() | |
| 26 out.close() |
