mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
Workaround a instable system call
This commit is contained in:
parent
fa90a7bb7c
commit
6ea74d6234
@ -45,25 +45,23 @@ class GdalUtils:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def runGdal(commands, progress):
|
def runGdal(commands, progress):
|
||||||
envval = unicode(os.getenv('PATH'))
|
envval = os.getenv('PATH')
|
||||||
# We need to give some extra hints to get things picked up on OS X
|
# We need to give some extra hints to get things picked up on OS X
|
||||||
if platform.system() == 'Darwin':
|
isDarwin = False
|
||||||
if os.path.isfile(os.path.join(QgsApplication.prefixPath(), "bin", "gdalinfo")):
|
try:
|
||||||
|
isDarwin = platform.system() == 'Darwin'
|
||||||
|
except IOError: # https://travis-ci.org/m-kuhn/QGIS#L1493-L1526
|
||||||
|
pass
|
||||||
|
if isDarwin and os.path.isfile(os.path.join(QgsApplication.prefixPath(), "bin", "gdalinfo")):
|
||||||
# Looks like there's a bundled gdal. Let's use it.
|
# Looks like there's a bundled gdal. Let's use it.
|
||||||
os.environ['PATH'] = "%s%s%s" % (os.path.join(QgsApplication.prefixPath(), "bin"), os.pathsep, envval)
|
os.environ['PATH'] = "{}{}{}".format(os.path.join(QgsApplication.prefixPath(), "bin"), os.pathsep, envval)
|
||||||
os.environ['DYLD_LIBRARY_PATH'] = os.path.join(QgsApplication.prefixPath(), "lib")
|
os.environ['DYLD_LIBRARY_PATH'] = os.path.join(QgsApplication.prefixPath(), "lib")
|
||||||
else:
|
|
||||||
# Nothing internal. Let's see if we can find it elsewhere.
|
|
||||||
settings = QSettings()
|
|
||||||
path = unicode(settings.value('/GdalTools/gdalPath', ''))
|
|
||||||
envval += '%s%s' % (os.pathsep, path)
|
|
||||||
os.putenv('PATH', envval)
|
|
||||||
else:
|
else:
|
||||||
# Other platforms should use default gdal finder codepath
|
# Other platforms should use default gdal finder codepath
|
||||||
settings = QSettings()
|
settings = QSettings()
|
||||||
path = unicode(settings.value('/GdalTools/gdalPath', ''))
|
path = settings.value('/GdalTools/gdalPath', '')
|
||||||
if not path.lower() in envval.lower().split(os.pathsep):
|
if not path.lower() in envval.lower().split(os.pathsep):
|
||||||
envval += '%s%s' % (os.pathsep, path)
|
envval += '{}{}'.format(os.pathsep, path)
|
||||||
os.putenv('PATH', envval)
|
os.putenv('PATH', envval)
|
||||||
|
|
||||||
loglines = []
|
loglines = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user