Ticket #172 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

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

Changed 5 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.

Changed 5 years ago by dagss

  • status changed from new to closed
  • resolution set to fixed

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

Changed 5 years ago by robertwb

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 5 years ago by robertwb

  • owner changed from somebody to dagss
  • status changed from reopened to new

Changed 5 years ago by robertwb

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