title: eval giving syntax error even when correct code given
body: <p>I have the following code, which uses the <code>eval</code> function:</p>
  
  <pre><code>lines = self.fulltext.splitlines()
  
  CURRENT = 0
  
  extractors = { "solar zenith angle" : (CURRENT, 1, "self.solar_z"),
                         "ground pressure" : (CURRENT, 2, "self.ground_pressure")                     
  
               }
  
  print locals()
  
  for line in lines:
      for label, details in extractors.iteritems():
          if label in line:
              if details[0] == CURRENT:
                  values = line.split()
                  eval("%s = values[%d]" % (details[2], details[1]))
  </code></pre>
  
  <p>However, when I run it I get the following error:</p>
  
  <pre><code>eval("%s = values[%d]" % (details[2], details[1]))
    File "&lt;string&gt;", line 1
      self.solar_z = values[1]
                   ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Why is this? <code>self.solar_z</code> is defined, and the statement that is eval'd looks correct.</p>