Skip to content

Commit dcdd3df

Browse files
fix NameError in the madgraph-in-PYTHONPATH guard of the launchers
Both bin/madevent (LO) and bin/aMCatNLO (NLO) import only `logging`, but the guard body called `logger.getLogger(...)`. The name `logger` is never bound in either script, so instead of warning that madgraph is importable the launcher died with NameError: name 'logger' is not defined Use `logging.getLogger('madgraph')` so the intended error is emitted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 49c0785 commit dcdd3df

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎Template/LO/bin/madevent‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ try:
185185
except ImportError:
186186
pass
187187
else:
188-
logger.getLogger('madgraph').error('Looks like you do have madgraph in your PYTHONPATH (or you run this executable from the main MG5aMC directory). This executable will likely not work in such case.')
188+
logging.getLogger('madgraph').error('Looks like you do have madgraph in your PYTHONPATH (or you run this executable from the main MG5aMC directory). This executable will likely not work in such case.')
189189

190190

191191

‎Template/NLO/bin/aMCatNLO‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ try:
170170
except ImportError:
171171
pass
172172
else:
173-
logger.getLogger('madgraph').error('Looks like you do have madgraph in your PYTHONPATH (or you run this executable from the main MG5aMC directory). This executable will likely not work in such case.')
173+
logging.getLogger('madgraph').error('Looks like you do have madgraph in your PYTHONPATH (or you run this executable from the main MG5aMC directory). This executable will likely not work in such case.')
174174

175175

176176
# Call the cmd interface main loop

0 commit comments

Comments
 (0)