From 0493847c4f3e5161c84f66b86291543e22793065 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Thu, 23 Apr 2009 20:08:25 +0200 Subject: [PATCH] #290: whoops --- Cython/Compiler/Parsing.py | 2 +- tests/errors/e2_packedstruct_T290.pyx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/errors/e2_packedstruct_T290.pyx diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 85919514..8cc72997 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -2168,7 +2168,7 @@ def p_c_struct_or_union_definition(s, pos, ctx): if s.systring == 'packed': packed = True s.next() - if s.sy != 'IDENT' and s.systring != 'struct': + if s.sy != 'IDENT' or s.systring != 'struct': s.expected('struct') # s.sy == ident 'struct' or 'union' kind = s.systring diff --git a/tests/errors/e2_packedstruct_T290.pyx b/tests/errors/e2_packedstruct_T290.pyx new file mode 100644 index 00000000..ee053ee2 --- /dev/null +++ b/tests/errors/e2_packedstruct_T290.pyx @@ -0,0 +1,6 @@ +cdef packed foo: + pass + +_ERRORS = u""" +1:12: Expected 'struct' +""" -- 2.26.2