blob: b8a190ad656439c40bd22a9e261429e011599070 [file] [log] [blame]
Georg Brandlfa2c61a2011-02-20 10:41:31 +00001# Generate python33stub.def out of python3.def
Martin v. Löwisd53ee5d2010-12-05 23:07:58 +00002# The regular import library cannot be used,
3# since it doesn't provide the right symbols for
4# data forwarding
Georg Brandlfa2c61a2011-02-20 10:41:31 +00005out = open("python33stub.def", "w")
6out.write('LIBRARY "python33"\n')
Martin v. Löwisd53ee5d2010-12-05 23:07:58 +00007out.write('EXPORTS\n')
8
9inp = open("python3.def")
10inp.readline()
11line = inp.readline()
12assert line.strip()=='EXPORTS'
13
14for line in inp:
Georg Brandlfa2c61a2011-02-20 10:41:31 +000015 # SYM1=python33.SYM2[ DATA]
Martin v. Löwisd53ee5d2010-12-05 23:07:58 +000016 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