  from django.core import management
  from django.core.management import BaseCommand, CommandError
  from django.core.management.utils import find_command, popen_wrapper
  from django.test import SimpleTestCase
  from django.utils import translation
  from django.utils.deprecation import RemovedInDjango20Warning
  from django.utils.six import StringIO
  
  
  class CommandTests(SimpleTestCase):
 
</s> remove import sys
 </s> add  </s> remove from django.utils.six import StringIO
 </s> add from django.test.utils import captured_stdout </s> remove from django.utils.six import BytesIO, StringIO
 </s> add from django.test.utils import captured_stderr
from django.utils.six import BytesIO
from django.test.utils import captured_stderr, captured_stdout
  from django.core import management
  from django.core.management import BaseCommand, CommandError
  from django.core.management.utils import find_command, popen_wrapper
  from django.test import SimpleTestCase
from django.test.utils import captured_stderr, captured_stdout
  from django.utils import translation
  from django.utils.deprecation import RemovedInDjango20Warning
  from django.utils.six import StringIO
  
  
  class CommandTests(SimpleTestCase):
keep keep keep add keep keep keep keep keep keep
 Fixed #23930 -- Added copies of captured_std* managers from CPython's test.support.

StringIO import was adapted for compatibility with Python 2. 
tests/user_commands/tests.py