blob: 21b9f56982f0fa349314c0c43f1095b40bff320b [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")
Antoine Pitrou71219da2011-02-25 14:31:09 +000010line = inp.readline()
Martin v. Löwis75aeaa92012-06-24 00:00:30 +020011while line.strip().startswith(';'):
12 line = inp.readline()
13line = inp.readline() # LIBRARY
Antoine Pitrou71219da2011-02-25 14:31:09 +000014assert line.strip()=='EXPORTS'
15
16for line in inp:
17 # SYM1=python33.SYM2[ DATA]
18 head, tail = line.split('.')
19 if 'DATA' in tail:
20 symbol, tail = tail.split(' ')
21 else:
22 symbol = tail.strip()
23 out.write(symbol+'\n')
24
25inp.close()
26out.close()