# code glitches in sconsUtils

XMLWordPrintable

## Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Templates:
• Team:

## Description

In looking over sconsUtils for ticket #2976 my linter found some errors in state.py. I suspect the code works anyway due to extra names being imported, but it's surprising that it works.

It is not clear that ARGUMENTS should be defined in the following:

  opt = "export"  if SCons.Script.ARGUMENTS.has_key(opt):  for kv in ARGUMENTS[opt].split(','):

utils is not imported; the code should use the global "log"

  utils.log.fail("Unrecognised compiler:%s" % env['cc'])

Also, it is not obvious that the global "log" will always be set (in which case it will be None and all logging statements will fail). But given the fact that this code works, and the failure is obvious is log is None, I'm guessing it is not worth putting in a guard for that.

## People

• Assignee:
Russell Owen
Reporter:
Russell Owen
Reviewers:
Simon Krughoff
Watchers:
Jim Bosch, Robert Lupton, Russell Owen, Simon Krughoff