Mercurial > cpython-lru_cache-weakref
annotate PC/python33gen.py @ 79063:2bdc8c8ea42e
Issue #15977: Fix memory leak in Modules/_ssl.c when the function _set_npn_protocols() is called multiple times
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Thu, 20 Sep 2012 12:42:54 +0200 |
| parents | 3f14119e4af7 |
| children |
| rev | line source |
|---|---|
| 68136 | 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 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: | |
| 17 # SYM1=python33.SYM2[ DATA] | |
| 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() |
