Skip to content

Commit

Permalink
Do not touch the environment variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
vasole committed Dec 13, 2023
1 parent 8f929ab commit a4fe565
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions PyMca5/PyMcaGui/PyMcaQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@
raise ImportError(
'No Qt wrapper found. Install PyQt5, PySide6 or PyQt6.')

_logger.info("BINDING set to %s" % BINDING)
_logger.info("BINDING set to %s" % BINDING)

if BINDING.lower() == "pyqt5":
BINDING = "PyQt5"
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
Expand All @@ -127,7 +128,7 @@
Slot = pyqtSlot

elif BINDING.lower() == "pyside2":
# try PySide2 (experimental)
BINDING = "PySide2"
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
Expand Down Expand Up @@ -195,6 +196,7 @@ class QThread(_ExecMixIn, QThread): pass
_platform_plugin_path)
elif BINDING.lower() == 'pyside6':
_logger.debug('Using PySide6 bindings')
BINDING = "PySide6"
import PySide6

from PySide6.QtCore import * # noqa
Expand Down Expand Up @@ -236,6 +238,7 @@ def width(self):

elif BINDING.lower() == 'pyqt6':
_logger.debug('Using PyQt6 bindings')
BINDING = "PyQt6"
import enum
from PyQt6 import QtCore
if QtCore.PYQT_VERSION < int("0x60300", 16):
Expand Down Expand Up @@ -421,6 +424,8 @@ class QObject(QObject, _Foo): pass
else:
raise ImportError('No Qt wrapper found. Install one of PyQt5, PySide6, PyQt6')

_logger.info("PyMcaQt.BINDING set to %s" % BINDING)

# provide a exception handler but not implement it by default
def exceptionHandler(type_, value, trace):
_logger.error("%s %s %s", type_, value, ''.join(traceback.format_tb(trace)))
Expand Down
2 changes: 1 addition & 1 deletion PyMca5/PyMcaGui/misc/QIPythonWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
# Set the QT API

import os
import sys

Expand Down

0 comments on commit a4fe565

Please sign in to comment.