Staging
v0.5.1
https://github.com/python/cpython
Revision 8fbdab50fc8f2b71f19b54f3a0208cfbf2be7713 authored by Serhiy Storchaka on 26 July 2017, 03:07:30 UTC, committed by Ned Deily on 26 July 2017, 03:07:30 UTC
Based on patches by Duane Griffin and Tim Mitchell.
(cherry picked from commit 753bca3934a7618a4fa96e107ad1c5c18633a683).
(cherry picked from commit 2f7f533cf6fb57fcedcbc7bd454ac59fbaf2c655)
1 parent 052f9d6
Raw File
Tip revision: 8fbdab50fc8f2b71f19b54f3a0208cfbf2be7713 authored by Serhiy Storchaka on 26 July 2017, 03:07:30 UTC
[3.3] [3.5] bpo-27945: Fixed various segfaults with dict. (GH-1657) (GH-1678) (#2396)
Tip revision: 8fbdab5
python33gen.py
# Generate python33stub.def out of python3.def
# The regular import library cannot be used,
# since it doesn't provide the right symbols for
# data forwarding
out = open("python33stub.def", "w")
out.write('LIBRARY "python33"\n')
out.write('EXPORTS\n')

inp = open("python3.def")
line = inp.readline()
while line.strip().startswith(';'):
    line = inp.readline()
line = inp.readline() # LIBRARY
assert line.strip()=='EXPORTS'

for line in inp:
    # SYM1=python33.SYM2[ DATA]
    head, tail = line.split('.')
    if 'DATA' in tail:
        symbol, tail = tail.split(' ')
    else:
        symbol = tail.strip()
    out.write(symbol+'\n')

inp.close()
out.close()
back to top