aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorRoman Lacko <backup.rlacko@gmail.com>2013-05-22 09:17:38 +0200
committerJohn Ehresman <jpe@wingware.com>2013-05-29 14:26:42 +0200
commitbf988374249370a9005ff751ac468f838da4753d (patch)
treef14fead157b63c185651b15cf65c9888cc4ef7c2 /PySide
parent188e960e496ad31839ab879e139c4f1cf9f10656 (diff)
Ignore QtCore import errors when initializing plugins folder
Change-Id: If7612f97bb03f353d644b26767b3867f04d17fff Reviewed-by: John Ehresman <jpe@wingware.com>
Diffstat (limited to 'PySide')
-rw-r--r--PySide/__init__.py.in22
1 files changed, 15 insertions, 7 deletions
diff --git a/PySide/__init__.py.in b/PySide/__init__.py.in
index a5b540cad..fb70ec0f1 100644
--- a/PySide/__init__.py.in
+++ b/PySide/__init__.py.in
@@ -18,19 +18,27 @@ def _setupQtDirectories():
path = os.environ['PATH']
try:
os.environ['PATH'] = opensslDir + os.pathsep + path
- from . import QtNetwork
- QtNetwork.QSslSocket.supportsSsl()
+ try:
+ from . import QtNetwork
+ except ImportError:
+ pass
+ else:
+ QtNetwork.QSslSocket.supportsSsl()
finally:
os.environ['PATH'] = path
# Tell Qt to look for plugins in the PySide package, if the
# plugins folder exists there, instead of just the default of
# looking only in Qt's install or build folder.
- from . import QtCore
- pluginsDir = os.path.join(pysideDir, 'plugins')
- if os.path.exists(pluginsDir) and \
- pluginsDir not in QtCore.QCoreApplication.libraryPaths():
- QtCore.QCoreApplication.addLibraryPath(pluginsDir)
+ try:
+ from . import QtCore
+ except ImportError:
+ pass
+ else:
+ pluginsDir = os.path.join(pysideDir, 'plugins')
+ if os.path.exists(pluginsDir) and \
+ pluginsDir not in QtCore.QCoreApplication.libraryPaths():
+ QtCore.QCoreApplication.addLibraryPath(pluginsDir)
_setupQtDirectories()