Updated codegen to work with python3.

Most changes were just replacing usage of "has_key" with "in".
Also updated the sorting function which was simplified and
changed to a "key" function instead of "cmp" (which is no longer
supported in python3. Verified everything builds with
python 2.7 and 3.

https://bugzilla.gnome.org/show_bug.cgi?id=678066
This commit is contained in:
Simon Feltman
2012-06-13 23:20:17 -07:00
committed by Colin Walters
parent 6d5484b296
commit 03611f7c06
5 changed files with 26 additions and 40 deletions

View File

@ -184,8 +184,8 @@ def codegen_main():
c_code = opts.generate_c_code
if c_code:
h = file(c_code + '.h', 'w')
c = file(c_code + '.c', 'w')
h = open(c_code + '.h', 'w')
c = open(c_code + '.c', 'w')
gen = codegen.CodeGenerator(all_ifaces,
opts.c_namespace,
opts.interface_prefix,