Skip to content

Fix / improve error message for comparisons - #2081

Merged
embray merged 1 commit into
astropy:masterfrom
taldcroft:time-operand-err
Feb 12, 2014
Merged

embray merged 1 commit into
astropy:masterfrom
taldcroft:time-operand-err

Conversation

@taldcroft

Copy link
Copy Markdown
Member

As first noticed in #1832, the error message for a failed Time comparison is broken. The current OperandTypeError class doesn't actually provide any error text. This PR fixes that and makes the messages more informative.

In [1]: from astropy.time import Time
In [2]: t1 = Time('J2000', scale='utc')
In [3]: t1 == None
ERROR: OperandTypeError: Unsupported operand type(s) for ==: 'Time' and 'NoneType' [astropy.time.core]

I don't think this rises to the level of needing mention in CHANGES.rst.

@embray

embray commented Feb 12, 2014

Copy link
Copy Markdown
Member

I concur; looks good.

embray added a commit that referenced this pull request Feb 12, 2014
Fix / improve error message for comparisons
@embray
embray merged commit 8409e4e into astropy:master Feb 12, 2014
@taldcroft
taldcroft deleted the time-operand-err branch February 12, 2014 17:35
embray added a commit that referenced this pull request Feb 25, 2014
Fix / improve error message for comparisons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants