Staging
v0.5.0
https://github.com/python/cpython
Raw File
Tip revision: 076ca6c3c8df3030307e548d9be792ce3c1c6eea authored by Martin Panter on 14 July 2016, 01:31:46 UTC
Issue #27369: Don’t test error message detail that changed in Expat 2.2.0
Tip revision: 076ca6c
python32gen.py
# Generate python32stub.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("python32stub.def", "w")
out.write('LIBRARY "python32"\n')
out.write('EXPORTS\n')

inp = open("python3.def")
inp.readline()
line = inp.readline()
assert line.strip()=='EXPORTS'

for line in inp:
    # SYM1=python32.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