Skip to content

Conversation

davidread
Copy link
Owner

This occurred because lstrip is the wrong tool here:

e = 'cannot import name numpy.core.multiarray'
str(e).lstrip('cannot import name ')
'umpy.core.multiarray'

Better:

str(e).replace('cannot import name ', '')
'numpy.core.multiarray'

--

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master --name-only -- '*.py' | flake8 --diff
  • whatsnew entry

…ed to import"

This occurred because lstrip is the wrong tool here:

>>> e = 'cannot import name numpy.core.multiarray'
>>> str(e).lstrip('cannot import name ')
'umpy.core.multiarray'

Better:

>>> str(e).replace('cannot import name ', '')
'numpy.core.multiarray'
@davidread
Copy link
Owner Author

Closing PR in favour of pandas-dev#16366

@davidread davidread closed this Jun 7, 2017
@davidread davidread deleted the fix-stripped-chars-in-import-error branch June 7, 2017 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant