Skip to content
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

Updating access to bpython version #204

Closed
wants to merge 3 commits into from

Conversation

@thornycrackers
Copy link

commented Oct 12, 2016

I don't know if this the correct way to do this but to get bpython working with my version of pudb I had to change this variable or else I was getting errors saying:

bpython.version
AttributeError: 'module' object has no attribute 'version'

After changing the snippet everything seemed to work fine.

@inducer

This comment has been minimized.

Copy link
Owner

commented Oct 12, 2016

Thanks for your patch. The purpose of the code you modified is to see if bpython is available. Could you modify it so that this succeeds for both the old behavior (defining .version) and the new (defining (.__version__)?

@thornycrackers

This comment has been minimized.

Copy link
Author

commented Oct 13, 2016

Does just importing bpython suffice to check if it's available? The line with the version doesn't get assigned or used so really couldn't we just delete it all together?

@inducer

This comment has been minimized.

Copy link
Owner

commented Oct 13, 2016

No. See #177.

@thornycrackers

This comment has been minimized.

Copy link
Author

commented Oct 13, 2016

Derp, it's right there in the code. I just used hasattr to check which I think should be good enough.

@inducer

This comment has been minimized.

Copy link
Owner

commented Oct 13, 2016

Not sure what problem you're having, but according to:

https://github.com/bpython/bpython/blob/master/bpython/__init__.py

both version and __version__ should be available. This is looking like it's something on your end. (And FWIW, I don't trust these idiotic demand loader things to even get hasattr right.)

@inducer inducer closed this Oct 13, 2016
@thornycrackers

This comment has been minimized.

Copy link
Author

commented Oct 13, 2016

I pip installed pudb and then tried to access the command line (Ctrl - x) and every time I try to it gives me an error on this line saying the attribute doesn't exist. I know both should be available but it doesn't work and I have to change these lines. If you don't like hasattr catch a AttributeError exception and then set HAS_BPYTHON to true

@inducer

This comment has been minimized.

Copy link
Owner

commented Oct 14, 2016

What happens if you run

import bpython
bpython.version

and

import bpython
bpython.__version__

outside of pudb?

@thornycrackers

This comment has been minimized.

Copy link
Author

commented Oct 14, 2016

2__tmux

Here is a screenshot

@inducer

This comment has been minimized.

Copy link
Owner

commented Oct 14, 2016

Fair enough:

https://github.com/bpython/bpython/blob/742a2d2af0bdcc7b65890eb918ecfca28d7da01a/bpython/__init__.py

Is there a reason why you're staying on a release of bpython that's >4 years old?

@asmeurer

This comment has been minimized.

Copy link
Collaborator

commented Oct 14, 2016

It seems like bpython.version is an accidental API bpython/bpython@74ce964. bpython.__version__ should likely be preferred.

@inducer

This comment has been minimized.

Copy link
Owner

commented Oct 15, 2016

Ok, you've convinced me. I've effectively merged the original version of @thornycrackers's patch. @thornycrackers, sorry for giving you the runaround on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.