Staging
v0.8.1
https://github.com/python/cpython
Revision 4322c178b9923cb687bcb6beea5f46df755d0b61 authored by Senthil Kumaran on 26 May 2012, 01:55:28 UTC, committed by Senthil Kumaran on 26 May 2012, 01:55:28 UTC
2 parent s 0b6f6c8 + ffa4b2c
Raw File
Tip revision: 4322c178b9923cb687bcb6beea5f46df755d0b61 authored by Senthil Kumaran on 26 May 2012, 01:55:28 UTC
Issue #14920: Fix the help(urllib.parse) failure on locale C terminals. Just have ascii in help msg
Tip revision: 4322c17
python33gen.py
# Generate python33stub.def out of python3.def
# The regular import library cannot be used,
# since it doesn't provide the right symbols for
# data forwarding
out = open("python33stub.def", "w")
out.write('LIBRARY "python33"\n')
out.write('EXPORTS\n')

inp = open("python3.def")
inp.readline()
line = inp.readline()
assert line.strip()=='EXPORTS'

for line in inp:
    # SYM1=python33.SYM2[ DATA]
    head, tail = line.split('.')
    if 'DATA' in tail:
        symbol, tail = tail.split(' ')
    else:
        symbol = tail.strip()
    out.write(symbol+'\n')

inp.close()
out.close()
back to top