Skip to content

Commit e7b38e0

Browse files
authored
build: enable ninja.py it import StringIO on Python 3
This change supports access to StringIO on both Python 2 and Python 3
1 parent bacf53d commit e7b38e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gyp/pylib/gyp/generator/ninja.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
import gyp.msvs_emulation
2020
import gyp.MSVSUtil as MSVSUtil
2121
import gyp.xcode_emulation
22-
from cStringIO import StringIO
22+
try:
23+
from cStringIO import StringIO
24+
except ImportError:
25+
from io import StringIO
2326

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

0 commit comments

Comments
 (0)