Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: import StringIO on both Python 2 and Python 3 #1836

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions gyp/pylib/gyp/MSVSSettings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@

"""Unit tests for the MSVSSettings.py file."""

import StringIO
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO

import unittest
import gyp.MSVSSettings as MSVSSettings


class TestSequenceFunctions(unittest.TestCase):

def setUp(self):
self.stderr = StringIO.StringIO()
self.stderr = StringIO()

def _ExpectedWarnings(self, expected):
"""Compares recorded lines to expected warnings."""
Expand Down
7 changes: 5 additions & 2 deletions gyp/pylib/gyp/easy_xml_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@

import gyp.easy_xml as easy_xml
import unittest
import StringIO
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO


class TestSequenceFunctions(unittest.TestCase):

def setUp(self):
self.stderr = StringIO.StringIO()
self.stderr = StringIO()

def test_EasyXml_simple(self):
self.assertEqual(
Expand Down
7 changes: 5 additions & 2 deletions gyp/pylib/gyp/generator/msvs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@

import gyp.generator.msvs as msvs
import unittest
import StringIO
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO


class TestSequenceFunctions(unittest.TestCase):

def setUp(self):
self.stderr = StringIO.StringIO()
self.stderr = StringIO()

def test_GetLibraries(self):
self.assertEqual(
Expand Down
5 changes: 4 additions & 1 deletion gyp/pylib/gyp/generator/ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import gyp.msvs_emulation
import gyp.MSVSUtil as MSVSUtil
import gyp.xcode_emulation
from cStringIO 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
Expand Down
1 change: 0 additions & 1 deletion gyp/pylib/gyp/generator/ninja_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import gyp.generator.ninja as ninja
import unittest
import StringIO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it not need to be replaced here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, looks like it isn't actually used here.

import sys
import TestCommon

Expand Down