Merge "Fix cString ImportError for py34"

This commit is contained in:
Jenkins
2016-09-30 01:49:58 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 5 deletions

View File

@@ -17,7 +17,6 @@
import urllib import urllib
import contextlib import contextlib
import cStringIO
import fixtures import fixtures
import mox import mox
import six import six
@@ -39,7 +38,7 @@ ENDURL = 'localurl'
@contextlib.contextmanager @contextlib.contextmanager
def capture_std_streams(): def capture_std_streams():
fake_stdout, fake_stderr = cStringIO.StringIO(), cStringIO.StringIO() fake_stdout, fake_stderr = six.StringIO(), six.StringIO()
stdout, stderr = sys.stdout, sys.stderr stdout, stderr = sys.stdout, sys.stderr
try: try:
sys.stdout, sys.stderr = fake_stdout, fake_stderr sys.stdout, sys.stderr = fake_stdout, fake_stderr

View File

@@ -14,10 +14,10 @@
# under the License. # under the License.
import argparse import argparse
import cStringIO
import logging import logging
import os import os
import re import re
import six
import sys import sys
import fixtures import fixtures
@@ -61,8 +61,8 @@ class ShellTest(testtools.TestCase):
clean_env = {} clean_env = {}
_old_env, os.environ = os.environ, clean_env.copy() _old_env, os.environ = os.environ, clean_env.copy()
try: try:
sys.stdout = cStringIO.StringIO() sys.stdout = six.StringIO()
sys.stderr = cStringIO.StringIO() sys.stderr = six.StringIO()
_shell = openstack_shell.TackerShell('1.0') _shell = openstack_shell.TackerShell('1.0')
_shell.run(argstr.split()) _shell.run(argstr.split())
except SystemExit: except SystemExit: