Skip to content

Commit a20a8f4

Browse files
cclausstargos
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 #29371. See: #29371 (comment) PR-URL: #29414 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
1 parent 95431ea commit a20a8f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
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)