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

qt imports fix #5134

Merged
merged 4 commits into from Sep 26, 2015
Merged

qt imports fix #5134

merged 4 commits into from Sep 26, 2015

Conversation

JGoutin
Copy link
Contributor

@JGoutin JGoutin commented Sep 24, 2015

Related to this pull request :
#4912

This fixes an error where PyQt4 would always be selected in the case where a Qt related file was imported, but not set as the current backend

Change from jrevans commit : Check what PyQt version is actually used rather than try to force the use of PyQt5.
@tacaswell tacaswell added this to the next point release (1.5.0) milestone Sep 24, 2015
@tacaswell
Copy link
Member

@jrevans Does this fix your problems?

# A different backend was specified, but we still got here because a Qt
# related file was imported. This is allowed, so lets try and guess
# what we should be using.
if "PyQt5" in sys.modules:
Copy link
Member

Choose a reason for hiding this comment

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

Can you invert this logic to check for pyqt4 and default to 5?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PyQt5 is default, now.

# A different backend was specified, but we still got here because a Qt
# related file was imported. This is allowed, so lets try and guess
# what we should be using.
if "PyQt4" in sys.modules:
Copy link
Member

Choose a reason for hiding this comment

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

This also needs to check for PySide, sorry I did not realize that before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the PyQt4 lines ?
I never used PySide. So, don't know its specificities.

Is the following change correct ?

if "PyQt4" in sys.modules:

=>

if "PyQt4" in sys.modules or "PySide" in sys.modules:

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that looks like.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PySide added.

@tacaswell
Copy link
Member

Thanks!

tacaswell added a commit that referenced this pull request Sep 26, 2015
@tacaswell tacaswell merged commit 87c9e4d into matplotlib:master Sep 26, 2015
@JGoutin JGoutin deleted the PyQt5-import-fix branch September 26, 2015 20:50
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.

None yet

2 participants