Skip to content

Commit

Permalink
Do not generate head enum declaration if no anonymous enums are gener…
Browse files Browse the repository at this point in the history
…ated.
  • Loading branch information
cournape committed Dec 1, 2008
1 parent 5656475 commit 408778f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cycodegen.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ def generate_cython(output, genitems, enumvals):
# Generate the cython code # Generate the cython code
cython_code = [cy_generate(i) for i in genitems] cython_code = [cy_generate(i) for i in genitems]


output.write("\tcdef enum:\n") if enumvals:
for i in enumvals: output.write("\tcdef enum:\n")
output.write("\t\t%s = %d\n" % (i.name, int(i.value))) for i in enumvals:
output.write("\t\t%s = %d\n" % (i.name, int(i.value)))
for i in cython_code: for i in cython_code:
if not i: if not i:
continue continue
Expand Down

0 comments on commit 408778f

Please sign in to comment.