blob: a85f417671c32279913e2cd516b8ab82e55033f5 [file] [log] [blame]
Antoine Pitrou71219da2011-02-25 14:31:09 +00001# 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
5out = open("python33stub.def", "w")
6out.write('LIBRARY "python33"\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=python33.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()