From a20a8f48f7b9b8243dd6db03e3fb2cd058208c03 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 3 Sep 2019 09:34:54 +0200 Subject: [PATCH] gyp: make StringIO work in ninja.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow both Python 2 and 3 to access StringIO. This fixes `./configure --ninja`, which was broken by https://github.com/nodejs/node/pull/29371. See: https://github.com/nodejs/node/pull/29371#issuecomment-527331969 PR-URL: https://github.com/nodejs/node/pull/29414 Reviewed-By: Michaƫl Zasso Reviewed-By: Sam Roberts --- 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..e66979ddbb5273 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