From cc96822d83ebeb522f7d0f4c2a68f52bd8689219 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 3 Sep 2019 09:34:54 +0200 Subject: [PATCH 1/2] gyp: make StringIO work in ninja.py Allow both Python 2 and 3 to access StringIO --- tools/gyp/pylib/gyp/generator/ninja.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/gyp/pylib/gyp/generator/ninja.py b/tools/gyp/pylib/gyp/generator/ninja.py index 7d1d3b7b30b5f1..1865dfc39bc9a7 100644 --- a/tools/gyp/pylib/gyp/generator/ninja.py +++ b/tools/gyp/pylib/gyp/generator/ninja.py @@ -20,7 +20,10 @@ import gyp.msvs_emulation import gyp.MSVSUtil as MSVSUtil import gyp.xcode_emulation -from io import StringIO +try: + from cStringIO import StringIO +except ImportError: + from io import StringIO from gyp.common import GetEnvironFallback import gyp.ninja_syntax as ninja_syntax From e572d2cf22e60b85d8606638ecb334eae8f0a827 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 3 Sep 2019 13:49:27 +0200 Subject: [PATCH 2/2] fixup! Use Google-style indentation --- tools/gyp/pylib/gyp/generator/ninja.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gyp/pylib/gyp/generator/ninja.py b/tools/gyp/pylib/gyp/generator/ninja.py index 1865dfc39bc9a7..e66979ddbb5273 100644 --- a/tools/gyp/pylib/gyp/generator/ninja.py +++ b/tools/gyp/pylib/gyp/generator/ninja.py @@ -21,9 +21,9 @@ import gyp.MSVSUtil as MSVSUtil import gyp.xcode_emulation try: - from cStringIO import StringIO + from cStringIO import StringIO except ImportError: - from io import StringIO + from io import StringIO from gyp.common import GetEnvironFallback import gyp.ninja_syntax as ninja_syntax