Opened 6 years ago

Closed 6 years ago

#172 closed defect (fixed)

Compiler crash for non-builtin ValueError plus numpy cimport

Reported by: jasone Owned by: dagss
Priority: minor Milestone: 0.11
Component: Code Generation Keywords:
Cc:

Description

The following code causes a cython crash (using cython-devel as of changeset 1523:965dc9fc3da7):

cimport numpy
class ValueError(object): pass
Traceback (most recent call last):
  [...]
  File "/home/jasone/cython/hg/cython-devel/Cython/Compiler/Code.py", line 325, in add_interned_string_decl
    if self.should_declare(entry.cname, entry):
  File "/home/jasone/cython/hg/cython-devel/Cython/Compiler/Code.py", line 313, in should_declare
    assert entry.type == other.type
AssertionError

Both entry.type and other.type claim to be <CArrayType None <CNumericType char>>, but they are definitely not equal (nor identical).

Note that numpy.pxd uses ValueError? in several places.

Change History (5)

comment:1 Changed 6 years ago by robertwb

No idea on this one, I added a test to the repo. The ValueError? in numpy.pxd should stay in that scope.

comment:2 Changed 6 years ago by dagss

  • Resolution set to fixed
  • Status changed from new to closed

This was due to == not being implemented for types. I'm using the str method instead to compare. http://hg.cython.org/cython-devel/rev/9e42904f7509

comment:3 Changed 6 years ago by robertwb

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:4 Changed 6 years ago by robertwb

  • Owner changed from somebody to dagss
  • Status changed from reopened to new

comment:5 Changed 6 years ago by robertwb

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.