Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Provide information about what kind is actually not integer kind #12093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2018

Conversation

yarikoptic
Copy link
Contributor

Otherwise it is hard to impossible to figure out what is the actual
value which fails the test.

See e.g. failing on 3.4 (only) tests of nibabel:
https://ci.appveyor.com/project/nipy/nibabel/build/1.0.498/job/eechfm1kxroa0rju#L598

Otherwise it is hard to impossible to figure out what is the actual
value which fails the test.

See e.g. failing on 3.4 (only) tests of nibabel:
https://ci.appveyor.com/project/nipy/nibabel/build/1.0.498/job/eechfm1kxroa0rju#L598
@@ -513,7 +513,7 @@ def __init__(self, int_type):
self.bits = self.dtype.itemsize * 8
self.key = "%s%d" % (self.kind, self.bits)
if self.kind not in 'iu':
raise ValueError("Invalid integer data type.")
raise ValueError("Invalid integer data type %r." % (self.kind,))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks harmless at first glance if it helps a downstream project. I don't think we have plans to explicitly support Python 3.4 issues moving forward, but this may be fair enough.

I suppose one could add a unit test that uses a regex on the ValueError message, although maybe that's overkill.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW those failures also happen with 3.5 at times (so I was told), or I misunderstood and this code path is 3.4 specific?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the issue isn't 3.4-specific that probably make a more compelling case to fix it

@mattip
Copy link
Member

mattip commented Oct 6, 2018

The code is already tested in test_getlimits.py via TestIinfo.test_basic, and the improvement indeed will help to debug failures.

@mattip mattip merged commit cb9add3 into numpy:master Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants