  import os
  import sys
  import warnings
  
  from django.db import connection
  from django.core import management
  from django.core.management import BaseCommand, CommandError
 
</s> remove import sys
 </s> add  </s> remove import sys
 </s> add  </s> remove from django.test.utils import override_settings
 </s> add from django.test.utils import captured_stdout, override_settings </s> remove import sys

 </s> add 
  import os

  import warnings
  
  from django.db import connection
  from django.core import management
  from django.core.management import BaseCommand, CommandError
keep replace 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