diff options
-rw-r--r-- | PySide/__init__.py.in | 22 |
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() |