Skip to content

Commit 40060f4

Browse files
cclausssam-github
authored andcommitted
gyp: make StringIO work in ninja.py
Allow both Python 2 and 3 to access StringIO. This fixes `./configure --ninja`, which was broken by nodejs#29371. See: nodejs#29371 (comment) PR-URL: nodejs#29414 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
1 parent 6ce87c0 commit 40060f4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/gyp/pylib/gyp/generator/ninja.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
import gyp.msvs_emulation
2121
import gyp.MSVSUtil as MSVSUtil
2222
import gyp.xcode_emulation
23-
from io import StringIO
23+
try:
24+
from cStringIO import StringIO
25+
except ImportError:
26+
from io import StringIO
2427

2528
from gyp.common import GetEnvironFallback
2629
import gyp.ninja_syntax as ninja_syntax

0 commit comments

Comments
 (0)