You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
584 B

15 years ago
  1. # 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
  5. out = open("python33stub.def", "w")
  6. out.write('LIBRARY "python33"\n')
  7. out.write('EXPORTS\n')
  8. inp = open("python3.def")
  9. inp.readline()
  10. line = inp.readline()
  11. assert line.strip()=='EXPORTS'
  12. for line in inp:
  13. # SYM1=python33.SYM2[ DATA]
  14. head, tail = line.split('.')
  15. if 'DATA' in tail:
  16. symbol, tail = tail.split(' ')
  17. else:
  18. symbol = tail.strip()
  19. out.write(symbol+'\n')
  20. inp.close()
  21. out.close()