tunghathanh / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

None portable dict comprehension for versions of python below 2.7 #403

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run gyp on a system with a version of python less than 2.7
2.
3.

What is the expected output? What do you see instead?
No error is expected.

Instead an exception is thrown:
  File "<mac_tool.py>", line 506

  {k : self.ExpandVariables(data[k], substitutions)) for k in data} 
                                                                                  ^
SyntaxError: invalid syntax

What version of the product are you using? On what operating system?
On MacOS Darwin-10.8.0-i386-64bit running python2.6

Please provide any additional information below.
A fix that would ensure portability across all versions of python:
   dict((k, self.ExpandVariables(data[k], substitutions)) for k in data) # Tested on versions of Python from 2.4 until 3.2

Original issue reported on code.google.com by emm.od...@gmail.com on 16 Jan 2014 at 1:52

GoogleCodeExporter commented 9 years ago
Duplicate of Issue 402 (https://code.google.com/p/gyp/issues/detail?id=402)

Original comment by jo...@bergstroem.nu on 20 Jan 2014 at 3:23