Bug#941034: Patch
Hello everybody out there!
Attached to this message, the patch that fixes the bug.
Best regards.
--
Yoann LE BARS
http://le-bars.net/yoann/
Diaspora* : ylebars@framasphere.org
--- import_pyqt.py (revision 2773)
+++ import_pyqt.py (revision 2774)
@@ -20,27 +20,35 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-ffado_pyqt_version = 4
-
-# This module handles the importing of PyQt modules for both PyQt4 and PyQt5.
-# The idea is to first try importing PyQt4. If there's an import error it's
-# assumed PyQt5 is present instead and that is tried.
+# This module handles the importing of PyQt modules for both PyQt4 and PyQt5
+# under Python2 or Python3. If Python3 is installed it is assumed that
+# PyQt5 is in use (this is reasonable because PyQt5 is what everyone wants
+# to use under Python3). Otherwise (that is, under Python2), an import of
+# PyQt4 is tried first; if an import error occurs then PyQt5 is assumed.
#
# All modules used by any part of ffado-mixer are imported. This greatly
# simplifies the process. Otherwise the modules to import would be delivered
# by string variables, and there isn't a supported way to do this across
# Python2 and Python3.
-try:
+
+import sys
+ffado_python3 = sys.version_info >= (3,)
+
+if ffado_python3:
+ ffado_pyqt_version = 5
+else:
+ try:
+ from PyQt4 import QtGui
+ ffado_pyqt_version = 4
+ except ImportError:
+ ffado_pyqt_version = 5
+
+if ffado_pyqt_version == 4:
from PyQt4 import QtGui, QtCore, Qt, uic
from PyQt4.QtCore import QByteArray, QObject, QTimer, Qt, pyqtSignal, QString, pyqtSlot
from PyQt4.QtGui import *
- ffado_pyqt_version = 4
-except ImportError:
+else:
from PyQt5 import QtGui, Qt, QtCore, Qt, QtWidgets, uic
from PyQt5.QtCore import QByteArray, QObject, pyqtSignal, pyqtSlot, QTimer, Qt
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
- ffado_pyqt_version = 5
-
-import sys
-ffado_python3 = sys.version_info >= (3,)
Reply to: