Skip to content

Commit

Permalink
FIx incorrect import which was causing a segmentation fault
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Sep 26, 2024
1 parent 414c47e commit 095b122
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions glue_qt/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,8 @@ def pytest_configure(config):
config.CFG_DIR = tempfile.mkdtemp()

# Start up QApplication, if the Qt code is present
try:
from glue.utils import get_qapp
except Exception:
# Note that we catch any exception, not just ImportError, because
# QtPy can raise a PythonQtError.
pass
else:
get_qapp()
from glue_qt.utils import get_qapp
get_qapp()

# Force loading of plugins
from glue.main import load_plugins
Expand All @@ -89,13 +83,8 @@ def pytest_unconfigure(config):
config.CFG_DIR = CFG_DIR_ORIG

# Remove reference to QApplication to prevent segmentation fault on PySide
try:
from glue.utils import app
app.qapp = None
except Exception: # for when we run the tests without the qt directories
# Note that we catch any exception, not just ImportError, because
# QtPy can raise a PythonQtError.
pass
from glue.utils import app
app.qapp = None

if OBJGRAPH_INSTALLED and not ON_APPVEYOR:

Expand Down

0 comments on commit 095b122

Please sign in to comment.