blob: 9182d54e64ccc18677579c3a1b5addaddc6e6d40 [file] [log] [blame]
Georg Brandl49857f82011-03-05 15:11:35 +01001# Generate python32stub.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
5out = open("python32stub.def", "w")
6out.write('LIBRARY "python32"\n')
7out.write('EXPORTS\n')
8
9inp = open("python3.def")
10inp.readline()
11line = inp.readline()
12assert line.strip()=='EXPORTS'
13
14for line in inp:
15 # SYM1=python32.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
23inp.close()
24out.close()
25