-
Notifications
You must be signed in to change notification settings - Fork 16
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
pylab import replaced by 'py' when matplotlib is not installed but py is #10
Comments
Oh, this is interesting! I cannot reproduce it:
Can you tell me what
and the reason I ask is I want to make sure it's not the plaintext output getting truncated midword (although I've no idea why it would be truncated midword). Another test would be to find out what Python interpreter is used for findimports with
and then run that interpreter and in it try
which for me produces '/tmp/py27/local/lib/python2.7/site-packages/pylab.pyc'. Actually, I have a Theory. Bear with me a moment. |
Reproduced!
produces the same output as your code. And the reason is that in this loop: Lines 502 to 509 in caa0e71
I'm trying to take off the last part of the dotted name with
and name.rfind('.') returns -1 when there are no dots in it, which cuts off the last character, one by one, until pylab becomes py, which exists in your site-packages! |
(In my defense I originally wrote this code in 2003. Python 2.3 was the modern version. str.rindex ... existed, so I've no excuse!) |
Released findimports 1.5.2 with the fix. |
Woh, thanks a lot, impressive response speed :-) |
Hi,
The
pylab
import is seen as apy
moduleCreate a file with just that import
Run findimports on it
The installed version is 1.5.1
Any idea what is going wrong ?
Thanks !
The text was updated successfully, but these errors were encountered: