Skip to content

Commit 4160e19

Browse files
committed
fix windows build
1 parent bcca7af commit 4160e19

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from builtins import zip
2727
import os
2828

29+
2930
def setupenv():
3031
"""
3132
Set the environment for Windows based on the .vars files from the
@@ -41,14 +42,18 @@ def setupenv():
4142
path_split = PurePath(os.path.dirname(os.path.realpath(__file__))).parts
4243

4344
try:
44-
appname = os.environ['QGIS_ENVNAME']
45+
appname = os.environ['QGIS_ENVNAME']
4546
except KeyError:
4647
appname = path_split[-3]
4748

48-
envfile= list(path_split[:-4])
49+
envfile = list(path_split[:-4])
4950
envfile.append("bin")
5051
envfile.append("{0}-bin.env".format(appname))
5152
envfile = os.path.join(*envfile)
53+
54+
if not os.path.exists(envfile):
55+
return
56+
5257
with open(envfile) as f:
5358
for line in f:
5459
linedata = line.split("=")

0 commit comments

Comments
 (0)