blob: e64f75243030ef1c71a8f61dad7263a96825dfde [file] [log] [blame]
Martin v. Löwisd53ee5d2010-12-05 23:07:58 +00001# 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