Permalink
Browse files

Do not generate head enum declaration if no anonymous enums are gener…

…ated.
  • Loading branch information...
1 parent 5656475 commit 408778fe4eeb0c3751252a6c6349c7a3984fde1a @cournape committed Dec 1, 2008
Showing with 4 additions and 3 deletions.
  1. +4 −3 cycodegen.py
View
@@ -11,9 +11,10 @@ def generate_cython(output, genitems, enumvals):
# Generate the cython code
cython_code = [cy_generate(i) for i in genitems]
- output.write("\tcdef enum:\n")
- for i in enumvals:
- output.write("\t\t%s = %d\n" % (i.name, int(i.value)))
+ if enumvals:
+ output.write("\tcdef enum:\n")
+ for i in enumvals:
+ output.write("\t\t%s = %d\n" % (i.name, int(i.value)))
for i in cython_code:
if not i:
continue

0 comments on commit 408778f

Please sign in to comment.