Skip to content

Fix use of NotImplemented in `glue.lal`

Duncan Macleod requested to merge duncanmmacleod/glue:fix-notimplemented into master

This MR fixes the use of the NotImplemented type in glue.lal.

Before this change:

>>> from glue import lal
>>> lal.LIGOTimeGPS(123)//4"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/duncan/git/glue/glue/lal.py", line 384, in __floordiv__
    raise NotImplemented
TypeError: exceptions must derive from BaseException

and after:

>>> from glue import lal
>>> lal.LIGOTimeGPS(123)//4"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: unsupported operand type(s) for //: 'LIGOTimeGPS' and 'int'

It's still a TypeError, but at least it's now the right one.

Merge request reports