Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(886)

Unified Diff: pylib/gyp/MSVSSettings_test.py

Issue 1454433002: Python 3 compatibility Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pylib/gyp/MSVSSettings_test.py
diff --git a/pylib/gyp/MSVSSettings_test.py b/pylib/gyp/MSVSSettings_test.py
index bf6ea6b802ff91f23780635e380a32c4744d1686..73ed25e27d4dda85e7b49500156dc7e173c3b9a3 100755
--- a/pylib/gyp/MSVSSettings_test.py
+++ b/pylib/gyp/MSVSSettings_test.py
@@ -6,7 +6,10 @@
"""Unit tests for the MSVSSettings.py file."""
-import StringIO
+try:
+ from StringIO import StringIO
+except ImportError:
+ from io import StringIO
Nico 2016/07/29 22:22:05 Isn't the recommended pattern "try py3 way, and if
AWhetter 2016/11/05 23:59:49 You're right. I've fixed this on my github.
import unittest
import gyp.MSVSSettings as MSVSSettings
@@ -14,7 +17,7 @@ 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."""

Powered by Google App Engine
This is Rietveld 408576698