Skip to content

Commit 4fa5249

Browse files
Luke DavisLuke Davis
authored andcommitted
Fix sconstruct, which was broken by the template.
Reverts the two previous attempts in 8502a29 and a9b58b5
1 parent 8502a29 commit 4fa5249

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sconstruct

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,6 @@ for dir in langDirs:
289289
)
290290
env.Depends(translatedManifest, ["buildVars.py"])
291291
env.Depends(addon, [translatedManifest, moFile])
292-
else: # Provide defaults for variables which didn't get assigned in above loop
293-
poFile = None
294-
moFile = None
295292

296293
pythonFiles = expandGlobs(buildVars.pythonSources)
297294
for file in pythonFiles:
@@ -300,9 +297,16 @@ for file in pythonFiles:
300297
# Convert markdown files to html
301298
# We need at least doc in English and should enable the Help button for the add-on in Add-ons Manager
302299
createAddonHelp("addon")
300+
try:
301+
303302
for mdFile in env.Glob(os.path.join('addon', 'doc', '*', '*.md')):
304303
htmlFile = env.markdown(mdFile)
305-
env.Depends(htmlFile, [mdFile, moFile])
304+
try: # It is possible that no moFile was set, because an add-on has no translations.
305+
moFile
306+
except NameError: # Done if there is no moFile
307+
env.Depends(htmlFile, mdFile)
308+
else: # Done if there is a moFile
309+
env.Depends(htmlFile, [mdFile, moFile])
306310
env.Depends(addon, htmlFile)
307311

308312
# Pot target

0 commit comments

Comments
 (0)