Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Issue 1454433002: Python 3 compatibility

Created:
5 years, 1 month ago by AWhetter
Modified:
4 years, 1 month ago
Reviewers:
Nico
CC:
gyp-developer_googlegroups.com
Base URL:
https://chromium.googlesource.com/external/gyp.git@master
Target Ref:
refs/heads/master
Project:
gyp
Visibility:
Public.

Description

Well this ended up being bigger than I anticipated! As well as being compatible with python 2, this changeset makes gyp (almost) compatible with python 3 as well. This is done without introducing any new module dependencies. As it's such a large changeset it may be easier to view it commit by commit, which you can do here: https://github.com/AWhetter/gyp/compare/python3Compat...python3Compatibility If this needs splitting into more changesets to make it more manageable then let me know! I realise that this is a big change to land in one go. Half of the line changes come just from updating print statements to include brackets! It's maybe worth looking at the commits anyway because I've tried to make the commit messages describe my thinking behind the change. I've tried to make the changes in here mainly syntax changes. I've put more "functional" changes into other changesets: Replaced custom OrderedDict with collections.OrderedDict (https://codereview.chromium.org/1429683005) Replaced deprecated os.path.walk usage with os.walk (https://codereview.chromium.org/1429933006) Replaced deprecated compiler module usage with the ast module (https://codereview.chromium.org/1406163007) There are some tests that still fail under python 3 but not under python 2. The test/variables/commands tests fail because the order of iteration of the parsed dictionary is not guaranteed. In python 2 this never seemed to be an issue but in python 3 the iteration order does changes intermittently. This in turn causes the print order of debug messages to change, and therefore not always match against the expected output. The way this test is checked needs to be reworked to pass under python 3. The other tests that fail under python 3 are the MSVS settings tests. This is a genuine test fail that is again caused by the order of dictionary iteration. On line 466 of pylib/gyp/MSVSSettings.py we iterate over the msvs_tool_settings items. The 'DefaultCharIsUnsigned' value requires 'AdditionalOptions' to have been converted first so that it resides in the msbuild_settings dictionary under the appropriate tool. A quick and dirty fix is to make msvs_tool_settings.items() sorted on this line. I wasn't sure how best to go about resolving these issues so they're up for discussion. Fixes issue #36 (https://bugs.chromium.org/p/gyp/issues/detail?id=36)

Patch Set 1 #

Patch Set 2 : Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) #

Total comments: 16
Unified diffs Side-by-side diffs Delta from patch set Stats (+1128 lines, -1206 lines) Patch
M PRESUBMIT.py View 1 chunk +1 line, -1 line 0 comments Download
M buildbot/buildbot_run.py View 7 chunks +13 lines, -11 lines 0 comments Download
M gyptest.py View 3 chunks +5 lines, -2 lines 0 comments Download
M pylib/gyp/MSVSNew.py View 1 chunk +18 lines, -3 lines 2 comments Download
M pylib/gyp/MSVSSettings.py View 7 chunks +22 lines, -14 lines 0 comments Download
M pylib/gyp/MSVSSettings_test.py View 2 chunks +5 lines, -2 lines 2 comments Download
M pylib/gyp/MSVSUserFile.py View 2 chunks +2 lines, -2 lines 0 comments Download
M pylib/gyp/MSVSUtil.py View 1 1 chunk +1 line, -1 line 0 comments Download
M pylib/gyp/MSVSVersion.py View 1 2 chunks +7 lines, -4 lines 0 comments Download
M pylib/gyp/__init__.py View 11 chunks +22 lines, -16 lines 0 comments Download
M pylib/gyp/common.py View 1 4 chunks +5 lines, -5 lines 2 comments Download
M pylib/gyp/common_test.py View 1 chunk +1 line, -0 lines 0 comments Download
M pylib/gyp/easy_xml.py View 2 chunks +5 lines, -1 line 0 comments Download
M pylib/gyp/easy_xml_test.py View 1 chunk +5 lines, -2 lines 0 comments Download
M pylib/gyp/flock_tool.py View 1 chunk +1 line, -1 line 0 comments Download
M pylib/gyp/generator/analyzer.py View 1 18 chunks +46 lines, -43 lines 0 comments Download
M pylib/gyp/generator/cmake.py View 1 6 chunks +14 lines, -6 lines 0 comments Download
M pylib/gyp/generator/dump_dependency_json.py View 2 chunks +3 lines, -1 line 0 comments Download
M pylib/gyp/generator/eclipse.py View 3 chunks +3 lines, -3 lines 0 comments Download
M pylib/gyp/generator/gypd.py View 1 chunk +1 line, -1 line 0 comments Download
M pylib/gyp/generator/make.py View 1 12 chunks +17 lines, -15 lines 0 comments Download
M pylib/gyp/generator/msvs.py View 1 37 chunks +45 lines, -52 lines 0 comments Download
M pylib/gyp/generator/msvs_test.py View 1 chunk +5 lines, -2 lines 0 comments Download
M pylib/gyp/generator/ninja.py View 1 14 chunks +21 lines, -15 lines 0 comments Download
M pylib/gyp/generator/ninja_test.py View 1 chunk +0 lines, -1 line 0 comments Download
M pylib/gyp/generator/xcode.py View 1 17 chunks +23 lines, -23 lines 0 comments Download
M pylib/gyp/input.py View 1 40 chunks +75 lines, -87 lines 2 comments Download
M pylib/gyp/input_test.py View 3 chunks +3 lines, -3 lines 0 comments Download
M pylib/gyp/mac_tool.py View 1 12 chunks +19 lines, -16 lines 0 comments Download
M pylib/gyp/msvs_emulation.py View 1 12 chunks +20 lines, -15 lines 0 comments Download
D pylib/gyp/ordered_dict.py View 1 chunk +0 lines, -289 lines 0 comments Download
M pylib/gyp/simple_copy.py View 2 chunks +14 lines, -3 lines 0 comments Download
M pylib/gyp/win_tool.py View 9 chunks +16 lines, -12 lines 0 comments Download
M pylib/gyp/xcode_emulation.py View 1 9 chunks +13 lines, -11 lines 0 comments Download
M pylib/gyp/xcode_ninja.py View 1 4 chunks +4 lines, -4 lines 0 comments Download
M pylib/gyp/xcodeproj_file.py View 19 chunks +29 lines, -24 lines 0 comments Download
M pylib/gyp/xml_fix.py View 1 chunk +1 line, -2 lines 0 comments Download
M test/actions-bare/src/bare.py View 1 chunk +1 line, -1 line 0 comments Download
M test/actions-multiple-outputs-with-dependencies/gyptest-action.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/actions-multiple-outputs/gyptest-multiple-outputs.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/actions-multiple/src/actions.gyp View 7 chunks +7 lines, -7 lines 2 comments Download
D test/actions-multiple/src/copy.py View 1 chunk +0 lines, -9 lines 0 comments Download
A + test/actions-multiple/src/copyfile.py View 0 chunks +-1 lines, --1 lines 0 comments Download
M test/actions-none/src/fake_cross.py View 1 chunk +1 line, -1 line 0 comments Download
M test/actions-subdir/src/make-file.py View 1 chunk +1 line, -1 line 0 comments Download
M test/actions-subdir/src/subdir/make-subdir-file.py View 1 chunk +1 line, -1 line 0 comments Download
M test/actions/src/subdir2/make-file.py View 1 chunk +1 line, -1 line 0 comments Download
M test/additional-targets/src/dir1/emit.py View 1 chunk +1 line, -1 line 0 comments Download
M test/analyzer/gyptest-analyzer.py View 1 4 chunks +21 lines, -19 lines 0 comments Download
M test/arflags/gyptest-arflags.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/compiler-override/my_cc.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/compiler-override/my_cxx.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/compiler-override/my_ld.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/compiler-override/my_nm.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/compiler-override/my_readelf.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/configurations/inheritance/gyptest-duplicates.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/configurations/target_platform/gyptest-target_platform.py View 1 chunk +1 line, -1 line 0 comments Download
M test/copies/gyptest-updir.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/custom-generator/mygenerator.py View 1 chunk +1 line, -1 line 0 comments Download
M test/dependencies/adso/write_args.py View 1 chunk +1 line, -1 line 0 comments Download
M test/determinism/gyptest-solibs.py View 1 2 chunks +3 lines, -1 line 0 comments Download
M test/determinism/rule.py View 1 1 chunk +3 lines, -1 line 0 comments Download
M test/errors/gyptest-errors.py View 1 chunk +5 lines, -2 lines 2 comments Download
M test/escaping/gyptest-colon.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/generator-output/actions/subdir2/make-file.py View 1 chunk +1 line, -1 line 0 comments Download
M test/generator-output/gyptest-mac-bundle.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/generator-output/rules/copy-file.py View 1 chunk +1 line, -1 line 0 comments Download
M test/hard_dependency/src/emit.py View 1 chunk +1 line, -1 line 0 comments Download
M test/ios/gyptest-app-ios.py View 1 2 chunks +4 lines, -2 lines 0 comments Download
M test/ios/gyptest-extension.py View 1 2 chunks +4 lines, -2 lines 0 comments Download
M test/ios/gyptest-per-config-settings.py View 1 6 chunks +10 lines, -8 lines 0 comments Download
M test/ios/gyptest-watch.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/lib/TestCmd.py View 35 chunks +112 lines, -120 lines 0 comments Download
M test/lib/TestCommon.py View 19 chunks +63 lines, -61 lines 0 comments Download
M test/lib/TestGyp.py View 1 9 chunks +17 lines, -15 lines 2 comments Download
M test/lib/TestMac.py View 2 chunks +5 lines, -3 lines 0 comments Download
M test/lib/TestWin.py View 1 chunk +1 line, -1 line 0 comments Download
M test/linux/gyptest-implicit-rpath.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/linux/ldflags-duplicates/check-ldflags.py View 1 chunk +4 lines, -2 lines 0 comments Download
M test/mac/gyptest-app.py View 3 chunks +5 lines, -3 lines 0 comments Download
M test/mac/gyptest-app-assets-catalog.py View 2 chunks +4 lines, -2 lines 0 comments Download
M test/mac/gyptest-app-error.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-bundle-resources.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/mac/gyptest-copies.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/mac/gyptest-depend-on-bundle.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-framework.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-infoplist-process.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-installname.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/mac/gyptest-ldflags-passed-to-libtool.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-loadable-module.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/mac/gyptest-lto.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/mac/gyptest-missing-cfbundlesignature.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-non-strs-flattened-to-env.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-postbuild-defaults.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-postbuild-fail.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/mac/gyptest-rebuild.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-sdkroot.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/mac/gyptest-sourceless-module.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/mac/gyptest-strip.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/mac/gyptest-strip-default.py View 2 chunks +4 lines, -2 lines 0 comments Download
M test/mac/gyptest-swift-library.py View 3 chunks +4 lines, -2 lines 0 comments Download
M test/mac/gyptest-xcode-env-order.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/make_global_settings/ar/gyptest-make_global_settings_ar.py View 1 1 chunk +1 line, -1 line 0 comments Download
M test/make_global_settings/basics/gyptest-make_global_settings.py View 2 chunks +2 lines, -2 lines 0 comments Download
M test/make_global_settings/full-toolchain/my_nm.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/make_global_settings/full-toolchain/my_readelf.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/make_global_settings/ld/gyptest-make_global_settings_ld.py View 1 chunk +1 line, -1 line 0 comments Download
M test/make_global_settings/wrapper/gyptest-wrapper.py View 1 chunk +1 line, -1 line 0 comments Download
M test/many-actions/gyptest-many-actions.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/many-actions/gyptest-many-actions-unsorted.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/msvs/config_attrs/gyptest-config_attrs.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/msvs/rules_stdout_stderr/rule_stderr.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/msvs/rules_stdout_stderr/rule_stdout.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/ninja/action-rule-hash/subdir/emit.py View 1 chunk +1 line, -1 line 0 comments Download
M test/ninja/action_dependencies/gyptest-action-dependencies.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/ninja/action_dependencies/src/emit.py View 1 chunk +1 line, -1 line 0 comments Download
M test/ninja/solibs_avoid_relinking/gyptest-solibs-avoid-relinking.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/no-cpp/gyptest-no-cpp.py View 1 chunk +4 lines, -2 lines 0 comments Download
M test/rules-dirname/gyptest-dirname.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/rules-dirname/src/copy-file.py View 1 chunk +1 line, -1 line 0 comments Download
M test/rules-rebuild/src/make-sources.py View 1 chunk +2 lines, -2 lines 0 comments Download
M test/rules-variables/gyptest-rules-variables.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/rules/gyptest-all.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/rules/gyptest-default.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/rules/src/copy-file.py View 1 chunk +1 line, -1 line 0 comments Download
M test/standalone/gyptest-standalone.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/symlinks/gyptest-symlinks.py View 1 chunk +2 lines, -2 lines 0 comments Download
M test/variables/commands/commands.gyp View 2 chunks +4 lines, -4 lines 2 comments Download
M test/variables/commands/commands-repeated.gyp View 3 chunks +7 lines, -7 lines 0 comments Download
M test/variables/commands/commands-repeated.gyp.stdout View 1 chunk +26 lines, -26 lines 0 comments Download
M test/variables/commands/commands-repeated.gypd.golden View 1 chunk +1 line, -1 line 0 comments Download
M test/variables/commands/commands.gyp.stdout View 1 chunk +13 lines, -13 lines 0 comments Download
M test/variables/commands/commands.gyp.ignore-env.stdout View 1 chunk +13 lines, -13 lines 0 comments Download
M test/variables/commands/commands.gypd.golden View 1 chunk +1 line, -1 line 0 comments Download
M test/variables/commands/gyptest-commands.py View 2 chunks +2 lines, -1 line 0 comments Download
M test/variables/commands/gyptest-commands-ignore-env.py View 2 chunks +2 lines, -1 line 0 comments Download
M test/variables/commands/gyptest-commands-repeated.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/variables/commands/repeated_multidir/print_cwd_basename.py View 1 chunk +2 lines, -1 line 0 comments Download
M test/variables/commands/test.py View 1 chunk +1 line, -1 line 0 comments Download
M test/variables/filelist/gyptest-filelist.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/variables/filelist/gyptest-filelist-golden.py View 2 chunks +4 lines, -2 lines 0 comments Download
M test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py View 1 chunk +1 line, -1 line 0 comments Download
M test/win/gyptest-cl-enable-enhanced-instruction-set.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/win/gyptest-cl-function-level-linking.py View 2 chunks +4 lines, -2 lines 0 comments Download
M test/win/gyptest-command-quote.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/win/gyptest-link-defrelink.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/win/gyptest-link-enable-uac.py View 2 chunks +4 lines, -4 lines 0 comments Download
M test/win/gyptest-link-enable-winrt.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/win/gyptest-link-enable-winrt-app-revision.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/win/gyptest-link-enable-winrt-target-platform-version.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/win/gyptest-link-large-pdb.py View 2 chunks +5 lines, -3 lines 0 comments Download
M test/win/gyptest-link-ordering.py View 4 chunks +5 lines, -3 lines 0 comments Download
M test/win/gyptest-link-restat-importlib.py View 2 chunks +3 lines, -1 line 0 comments Download
M test/win/gyptest-link-update-manifest.py View 1 chunk +1 line, -1 line 0 comments Download
M test/win/gyptest-macro-targetfilename.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/win/gyptest-rc-build.py View 1 chunk +3 lines, -1 line 0 comments Download
M test/win/idl-excluded/copy-file.py View 1 chunk +1 line, -1 line 0 comments Download
M test/win/vs-macros/as.py View 2 chunks +4 lines, -2 lines 0 comments Download
M tools/graphviz.py View 3 chunks +16 lines, -14 lines 0 comments Download
M tools/pretty_gyp.py View 1 2 chunks +6 lines, -4 lines 0 comments Download
M tools/pretty_sln.py View 4 chunks +25 lines, -23 lines 0 comments Download
M tools/pretty_vcproj.py View 4 chunks +27 lines, -38 lines 0 comments Download

Messages

Total messages: 10 (6 generated)
AWhetter
Well this ended up being bigger than I anticipated!
5 years, 1 month ago (2015-11-16 22:03:11 UTC) #5
AWhetter
4 years, 8 months ago (2016-04-09 15:37:54 UTC) #7
Nico
Thanks for the patch, this looks really good. A few questions below, I commented on ...
4 years, 4 months ago (2016-07-29 22:22:06 UTC) #9
AWhetter
4 years, 1 month ago (2016-11-05 23:59:50 UTC) #10
I've rebased with master again and pushed these changes to github. Let me know
if you think it needs more work!

https://codereview.chromium.org/1454433002/diff/20001/pylib/gyp/MSVSNew.py
File pylib/gyp/MSVSNew.py (right):

https://codereview.chromium.org/1454433002/diff/20001/pylib/gyp/MSVSNew.py#ne...
pylib/gyp/MSVSNew.py:64: def __lt__(self, other):
On 2016/07/29 at 22:22:05, Nico (mostly afk Wed-Fri) wrote:
> This looks like an unfortunate change :-/

It is really. I could make it slighty easier on the eyes and do something like
add a _cmp method that takes an operator as an argument, and __lt__, __gt__, etc
call that with an operator.

https://codereview.chromium.org/1454433002/diff/20001/pylib/gyp/MSVSSettings_...
File pylib/gyp/MSVSSettings_test.py (right):

https://codereview.chromium.org/1454433002/diff/20001/pylib/gyp/MSVSSettings_...
pylib/gyp/MSVSSettings_test.py:12: from io import StringIO
On 2016/07/29 at 22:22:05, Nico (mostly afk Wed-Fri) wrote:
> Isn't the recommended pattern "try py3 way, and if that fails fall back to
py2"?

You're right. I've fixed this on my github.

https://codereview.chromium.org/1454433002/diff/20001/pylib/gyp/common.py
File pylib/gyp/common.py (right):

https://codereview.chromium.org/1454433002/diff/20001/pylib/gyp/common.py#new...
pylib/gyp/common.py:348: self.tmp_file = os.fdopen(tmp_fd, 'w')
On 2016/07/29 at 22:22:06, Nico (mostly afk Wed-Fri) wrote:
> doesn't this change behavior on windows?

Yes but we only ever write text so I think we should be doing this anyway?

https://codereview.chromium.org/1454433002/diff/20001/pylib/gyp/input.py
File pylib/gyp/input.py (right):

https://codereview.chromium.org/1454433002/diff/20001/pylib/gyp/input.py#newc...
pylib/gyp/input.py:1209: for key, value in the_dict.items():
On 2016/07/29 at 22:22:06, Nico (mostly afk Wed-Fri) wrote:
> Did you measure if this change makes gyp slower when running with 2.7?

Just with a few runs of all of the tests, I got the same run time of 2m50s for
both with and without the changes. My guess is the dictionaries are small enough
for the switch from list to generator to not make a big difference.

https://codereview.chromium.org/1454433002/diff/20001/test/actions-multiple/s...
File test/actions-multiple/src/actions.gyp (right):

https://codereview.chromium.org/1454433002/diff/20001/test/actions-multiple/s...
test/actions-multiple/src/actions.gyp:29: 'inputs': [
On 2016/07/29 at 22:22:06, Nico (ooo until Aug 1) wrote:
> why this change?

I renamed copy.py to copyfile.py because
> Down the import dependency chain of copy.py the 'tarfile' module was trying to
import the 'copy' standard library module but was finding the copy.py file first
because it was in the current directory.

I get the following error with Python 3 if I don't rename the file:
Traceback (most recent call last):
  File "copy.py", line 6, in <module>
    import shutil
  File "/usr/lib/python3.5/shutil.py", line 13, in <module>
    import tarfile
  File "/usr/lib/python3.5/tarfile.py", line 49, in <module>
    import copy
  File
"/home/ashley/workspace/gyp/out/testworkarea/testgyp.giniq4wt/relocate/src/copy.py",
line 9, in <module>
    shutil.copyfile(sys.argv[1], sys.argv[2])
AttributeError: module 'shutil' has no attribute 'copyfile'

https://codereview.chromium.org/1454433002/diff/20001/test/errors/gyptest-err...
File test/errors/gyptest-errors.py (right):

https://codereview.chromium.org/1454433002/diff/20001/test/errors/gyptest-err...
test/errors/gyptest-errors.py:44: "target2.*target0.*target1.*target2).*")
On 2016/07/29 at 22:22:06, Nico (ooo until Aug 1) wrote:
> why this change?

To quote the commit message:
> The order in which the nodes of a cycle are printed is unpredictable. I
believe this is because the order of iteration over the items in the dependency
dictionary is unpredictable. Therefore the error tests now match against all the
possible orderings of dependencies in a detected cycle.

https://codereview.chromium.org/1454433002/diff/20001/test/lib/TestGyp.py
File test/lib/TestGyp.py (right):

https://codereview.chromium.org/1454433002/diff/20001/test/lib/TestGyp.py#new...
test/lib/TestGyp.py:891: C:/USERS/yourname/AppData/Local. It will cause needless
work.  The ouptut
On 2016/07/29 at 22:22:06, Nico (mostly afk Wed-Fri) wrote:
> out of interest, is this needed? with \ it's more convenient to paste into
cmd.exe i suppose

I've worked around it by making the docstring a raw string instead. So they're
back to being backslashes again.

https://codereview.chromium.org/1454433002/diff/20001/test/variables/commands...
File test/variables/commands/commands.gyp (right):

https://codereview.chromium.org/1454433002/diff/20001/test/variables/commands...
test/variables/commands/commands.gyp:11: 'pi': 'import math; print(math.pi)',
On 2016/07/29 at 22:22:06, Nico (mostly afk Wed-Fri) wrote:
> hmm doesn't this need an `from __future__ import print_function` too when
running gyp under python 2.7?

Nope. Using brackets is optional in Python 2.7.

>>> print 'test'
test
>>> print('test')
test
>>> print 'Hello', 'world'
Hello world
>>> print('Hello', 'world')
('Hello', 'world')

Powered by Google App Engine
This is Rietveld 408576698