>>> py3-nose: Building community/py3-nose 1.3.7-r11 (using abuild 3.12.0-r0) started Mon, 23 Oct 2023 05:44:45 +0000
>>> py3-nose: Checking sanity of /home/buildozer/aports/community/py3-nose/APKBUILD...
>>> WARNING: py3-nose: No maintainer
>>> py3-nose: Analyzing dependencies...
>>> py3-nose: Installing for build: build-base python3 py3-setuptools
(1/19) Installing libbz2 (1.0.8-r6)
(2/19) Installing libffi (3.4.4-r3)
(3/19) Installing gdbm (1.23-r1)
(4/19) Installing xz-libs (5.4.4-r0)
(5/19) Installing mpdecimal (2.5.1-r2)
(6/19) Installing libpanelw (6.4_p20231007-r0)
(7/19) Installing readline (8.2.1-r2)
(8/19) Installing sqlite-libs (3.43.2-r0)
(9/19) Installing python3 (3.11.6-r1)
(10/19) Installing python3-pycache-pyc0 (3.11.6-r1)
(11/19) Installing pyc (3.11.6-r1)
(12/19) Installing python3-pyc (3.11.6-r1)
(13/19) Installing py3-parsing (3.1.1-r0)
(14/19) Installing py3-parsing-pyc (3.1.1-r0)
(15/19) Installing py3-packaging (23.2-r0)
(16/19) Installing py3-packaging-pyc (23.2-r0)
(17/19) Installing py3-setuptools (68.2.2-r0)
(18/19) Installing py3-setuptools-pyc (68.2.2-r0)
(19/19) Installing .makedepends-py3-nose (20231023.054501)
Executing busybox-1.36.1-r13.trigger
OK: 425 MiB in 121 packages
>>> py3-nose: Cleaning up srcdir
>>> py3-nose: Cleaning up pkgdir
>>> py3-nose: Cleaning up tmpdir
>>> py3-nose: Fetching https://distfiles.alpinelinux.org/distfiles/v3.19/nose-1.3.7.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0   146    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
>>> py3-nose: Fetching https://files.pythonhosted.org/packages/source/n/nose/nose-1.3.7.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100  273k  100  273k    0     0  1850k      0 --:--:-- --:--:-- --:--:-- 1850k
>>> py3-nose: Fetching https://distfiles.alpinelinux.org/distfiles/v3.19/nose-1.3.7.tar.gz
>>> py3-nose: Checking sha512sums...
nose-1.3.7.tar.gz: OK
coverage4-compat.patch: OK
python3.5-compat.patch: OK
fix-crashing-from-UnicodeDecodeError.patch: OK
fix-doctests-unicode.patch: OK
python3.6-compat.patch: OK
py311-compat.patch: OK
>>> py3-nose: Unpacking /var/cache/distfiles/v3.19/nose-1.3.7.tar.gz...
>>> py3-nose: coverage4-compat.patch
patching file nose/plugins/cover.py
>>> py3-nose: python3.5-compat.patch
patching file functional_tests/test_load_tests_from_test_case.py
patching file nose/util.py
patching file unit_tests/test_xunit.py
>>> py3-nose: fix-crashing-from-UnicodeDecodeError.patch
patching file nose/plugins/capture.py
patching file unit_tests/test_capture_plugin.py
>>> py3-nose: fix-doctests-unicode.patch
patching file nose/plugins/doctests.py
>>> py3-nose: python3.6-compat.patch
patching file functional_tests/test_loader.py
Hunk #1 succeeded at 369 (offset -3 lines).
patching file functional_tests/test_withid_failures.rst
>>> py3-nose: py311-compat.patch
patching file nose/plugins/manager.py
patching file nose/util.py
patching file nose/util.py
/usr/bin/2to3:3: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
  from lib2to3.main import main
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: No changes to bin/nosetests
RefactoringTool: No changes to nose/__init__.py
RefactoringTool: No changes to nose/__main__.py
RefactoringTool: Refactored nose/case.py
RefactoringTool: Refactored nose/commands.py
RefactoringTool: Refactored nose/config.py
RefactoringTool: Refactored nose/core.py
--- nose/case.py	(original)
+++ nose/case.py	(refactored)
@@ -341,7 +341,7 @@
         self.descriptor = descriptor
         if isfunction(method):
             raise ValueError("Unbound methods must be wrapped using pyversion.unbound_method before passing to MethodTestCase")
-        self.cls = method.im_class
+        self.cls = method.__self__.__class__
         self.inst = self.cls()
         if self.test is None:
             method_name = self.method.__name__
--- nose/commands.py	(original)
+++ nose/commands.py	(refactored)
@@ -148,7 +148,7 @@
 
             ei_cmd = self.get_finalized_command("egg_info")
             argv = ['nosetests', '--where', ei_cmd.egg_base] 
-            for (option_name, cmd_name) in self.option_to_cmds.items():
+            for (option_name, cmd_name) in list(self.option_to_cmds.items()):
                 if option_name in option_blacklist:
                     continue
                 value = getattr(self, option_name)
--- nose/config.py	(original)
+++ nose/config.py	(refactored)
@@ -3,7 +3,7 @@
 import os
 import re
 import sys
-import ConfigParser
+import configparser
 from optparse import OptionParser
 from nose.util import absdir, tolist
 from nose.plugins.manager import NoPlugins
@@ -62,24 +62,24 @@
     def _readFromFilenames(self, filenames):
         config = []
         for filename in filenames:
-            cfg = ConfigParser.RawConfigParser()
+            cfg = configparser.RawConfigParser()
             try:
                 cfg.read(filename)
-            except ConfigParser.Error, exc:
+            except configparser.Error as exc:
                 raise ConfigError("Error reading config file %r: %s" %
                                   (filename, str(exc)))
             config.extend(self._configTuples(cfg, filename))
         return config
 
     def _readFromFileObject(self, fh):
-        cfg = ConfigParser.RawConfigParser()
+        cfg = configparser.RawConfigParser()
         try:
             filename = fh.name
         except AttributeError:
             filename = '<???>'
         try:
             cfg.readfp(fh)
-        except ConfigParser.Error, exc:
+        except configparser.Error as exc:
             raise ConfigError("Error reading config file %r: %s" %
                               (filename, str(exc)))
         return self._configTuples(cfg, filename)
@@ -89,7 +89,7 @@
             config_files.readline
         except AttributeError:
             filename_or_filenames = config_files
-            if isinstance(filename_or_filenames, basestring):
+            if isinstance(filename_or_filenames, str):
                 filenames = [filename_or_filenames]
             else:
                 filenames = filename_or_filenames
@@ -113,12 +113,12 @@
                 continue
             try:
                 self._processConfigValue(name, value, values, parser)
-            except NoSuchOptionError, exc:
+            except NoSuchOptionError as exc:
                 self._file_error(
                     "Error reading config file %r: "
                     "no such option %r" % (filename, exc.name),
                     name=name, filename=filename)
-            except optparse.OptionValueError, exc:
+            except optparse.OptionValueError as exc:
                 msg = str(exc).replace('--' + name, repr(name), 1)
                 self._file_error("Error reading config file %r: "
                                  "%s" % (filename, msg),
@@ -128,12 +128,12 @@
         values = self._parser.get_default_values()
         try:
             config = self._readConfiguration(config_files)
-        except ConfigError, exc:
+        except ConfigError as exc:
             self._error(str(exc))
         else:
             try:
                 self._applyConfigurationToValues(self._parser, config, values)
-            except ConfigError, exc:
+            except ConfigError as exc:
                 self._error(str(exc))
         return self._parser.parse_args(args, values)
 
@@ -195,7 +195,7 @@
                                           r'^_',
                                           r'^setup\.py$',
                                           ]
-        self.ignoreFiles = map(re.compile, self.ignoreFilesDefaultStrings)
+        self.ignoreFiles = list(map(re.compile, self.ignoreFilesDefaultStrings))
         self.include = None
         self.loggingConfig = None
         self.logStream = sys.stderr
@@ -247,7 +247,7 @@
         d = self.__dict__.copy()
         # don't expose env, could include sensitive info
         d['env'] = {}
-        keys = [ k for k in d.keys()
+        keys = [ k for k in list(d.keys())
                  if not k.startswith('_') ]
         keys.sort()
         return "Config(%s)" % ', '.join([ '%s=%r' % (k, d[k])
@@ -328,17 +328,17 @@
             self.testMatch = re.compile(options.testMatch)
 
         if options.ignoreFiles:
-            self.ignoreFiles = map(re.compile, tolist(options.ignoreFiles))
+            self.ignoreFiles = list(map(re.compile, tolist(options.ignoreFiles)))
             log.info("Ignoring files matching %s", options.ignoreFiles)
         else:
             log.info("Ignoring files matching %s", self.ignoreFilesDefaultStrings)
 
         if options.include:
-            self.include = map(re.compile, tolist(options.include))
+            self.include = list(map(re.compile, tolist(options.include)))
             log.info("Including tests matching %s", options.include)
 
         if options.exclude:
-            self.exclude = map(re.compile, tolist(options.exclude))
+            self.exclude = list(map(re.compile, tolist(options.exclude)))
             log.info("Excluding tests matching %s", options.exclude)
 
         # When listing plugins we don't want to run them
@@ -623,15 +623,15 @@
     def __getnewargs__(self):
         return ()
 
-    def __nonzero__(self):
+    def __bool__(self):
         return False
 
 
 def user_config_files():
     """Return path to any existing user config files
     """
-    return filter(os.path.exists,
-                  map(os.path.expanduser, config_files))
+    return list(filter(os.path.exists,
+                  list(map(os.path.expanduser, config_files))))
 
 
 def all_config_files():
--- nose/core.py	(original)
+++ nose/core.py	(refactored)
@@ -1,6 +1,6 @@
 """Implements nose test program and collector.
 """
-from __future__ import generators
+
 
 import logging
 import os
@@ -150,7 +150,7 @@
         if self.config.options.version:
             from nose import __version__
             sys.stdout = sys.__stdout__
-            print "%s version %s" % (os.path.basename(sys.argv[0]), __version__)
+            print("%s version %s" % (os.path.basename(sys.argv[0]), __version__))
             sys.exit(0)
 
         if self.config.options.showPlugins:
@@ -224,26 +224,26 @@
         v = self.config.verbosity
         self.config.plugins.sort()
         for p in self.config.plugins:
-            print "Plugin %s" % p.name
+            print("Plugin %s" % p.name)
             if v >= 2:
-                print "  score: %s" % p.score
-                print '\n'.join(textwrap.wrap(p.help().strip(),
+                print("  score: %s" % p.score)
+                print('\n'.join(textwrap.wrap(p.help().strip(),
                                               initial_indent='  ',
-                                              subsequent_indent='  '))
+                                              subsequent_indent='  ')))
                 if v >= 3:
                     parser = DummyParser()
                     p.addOptions(parser)
                     if len(parser.options):
-                        print
-                        print "  Options:"
+                        print()
+                        print("  Options:")
                         for opts, help in parser.options:
-                            print '  %s' % (', '.join(opts))
+                            print('  %s' % (', '.join(opts)))
                             if help:
-                                print '\n'.join(
+                                print('\n'.join(
RefactoringTool: No changes to nose/exc.py
RefactoringTool: Refactored nose/failure.py
RefactoringTool: No changes to nose/importer.py
RefactoringTool: Refactored nose/inspector.py
RefactoringTool: Refactored nose/loader.py
RefactoringTool: No changes to nose/proxy.py
RefactoringTool: Refactored nose/pyversion.py
RefactoringTool: Refactored nose/result.py
RefactoringTool: Refactored nose/selector.py
                                     textwrap.wrap(help.strip(),
                                                   initial_indent='    ',
-                                                  subsequent_indent='    '))
-                print
+                                                  subsequent_indent='    ')))
+                print()
 
     def usage(cls):
         import nose
--- nose/failure.py	(original)
+++ nose/failure.py	(refactored)
@@ -36,7 +36,7 @@
     def runTest(self):
         if self.tb is not None:
             if is_base_exception(self.exc_val):
-                raise self.exc_val, None, self.tb
-            raise self.exc_class, self.exc_val, self.tb
+                raise self.exc_val.with_traceback(self.tb)
+            raise self.exc_class(self.exc_val).with_traceback(self.tb)
         else:
             raise self.exc_class(self.exc_val)
--- nose/inspector.py	(original)
+++ nose/inspector.py	(refactored)
@@ -9,9 +9,9 @@
 import tokenize
 
 try:
-    from cStringIO import StringIO
+    from io import StringIO
 except ImportError:
-    from StringIO import StringIO
+    from io import StringIO
 
 log = logging.getLogger(__name__)
 
@@ -38,7 +38,7 @@
         try:
             for tok in tokenize.generate_tokens(src.readline):
                 exp(*tok)
-        except tokenize.TokenError, e:
+        except tokenize.TokenError as e:
             # this can happen if our inspectable region happens to butt up
             # against the end of a construct like a docstring with the closing
             # """ on separate line
--- nose/loader.py	(original)
+++ nose/loader.py	(refactored)
@@ -6,7 +6,7 @@
 superclass, unittest.TestLoader, but extends it by more liberal
 interpretations of what may be a test and how a test may be named.
 """
-from __future__ import generators
+
 
 import logging
 import os
@@ -113,7 +113,7 @@
                 return False
             return sel.wantMethod(item)
 
-        cases = filter(wanted, dir(testCaseClass))
+        cases = list(filter(wanted, dir(testCaseClass)))
 
         # add runTest if nothing else picked
         if not cases and hasattr(testCaseClass, 'runTest'):
@@ -224,7 +224,7 @@
                 # Plugins can yield False to indicate that they were
                 # unable to load tests from a file, but it was not an
                 # error -- the file just had no tests to load.
-                tests = filter(None, tests)
+                tests = [_f for _f in tests if _f]
                 return self.suiteClass(tests)
             else:
                 # Nothing was able to even try to load from this file
@@ -274,7 +274,7 @@
         # convert the unbound generator method
         # into a bound method so it can be called below
         if hasattr(generator, 'im_class'):
-            cls = generator.im_class
+            cls = generator.__self__.__class__
         inst = cls()
         method = generator.__name__
         generator = getattr(inst, method)
@@ -329,8 +329,7 @@
                     test_funcs.append(test)
             sort_list(test_classes, lambda x: x.__name__)
             sort_list(test_funcs, func_lineno)
-            tests = map(lambda t: self.makeTest(t, parent=module),
-                        test_classes + test_funcs)
+            tests = [self.makeTest(t, parent=module) for t in test_classes + test_funcs]
 
         # Now, descend into packages
         # FIXME can or should this be lazy?
--- nose/pyversion.py	(original)
+++ nose/pyversion.py	(refactored)
@@ -16,12 +16,12 @@
 # In Python 3.x, all strings are unicode (the call to 'unicode()' in the 2.x
 # source will be replaced with 'str()' when running 2to3, so this test will
 # then become true)
-UNICODE_STRINGS = (type(unicode()) == type(str()))
+UNICODE_STRINGS = (type(str()) == type(str()))
 
 if sys.version_info[:2] < (3, 0):
     def force_unicode(s, encoding='UTF-8'):
         try:
-            s = unicode(s)
+            s = str(s)
         except UnicodeDecodeError:
             s = str(s).decode(encoding, 'replace')
 
@@ -35,7 +35,7 @@
 try:
     import new
     def make_instancemethod(function, instance):
-        return new.instancemethod(function.im_func, instance,
+        return new.instancemethod(function.__func__, instance,
                                   instance.__class__)
 except ImportError:
     def make_instancemethod(function, instance):
@@ -73,8 +73,8 @@
 # thus types.ClassType and types.TypeType don't exist anymore.  For
 # compatibility, we make sure they still work.
 if hasattr(types, 'ClassType'):
-    ClassType = types.ClassType
-    TypeType = types.TypeType
+    ClassType = type
+    TypeType = type
 else:
     ClassType = type
     TypeType = type
@@ -90,7 +90,7 @@
         self._func = func
         self.__self__ = UnboundSelf(cls)
         if sys.version_info < (3, 0):
-            self.im_class = cls
+            self.__self__.__class__ = cls
         self.__doc__ = getattr(func, '__doc__', None)
 
     def address(self):
@@ -161,7 +161,7 @@
 
     def isgenerator(func):
         try:
-            return func.func_code.co_flags & CO_GENERATOR != 0
+            return func.__code__.co_flags & CO_GENERATOR != 0
         except AttributeError:
             return False
 
@@ -187,8 +187,8 @@
                 msg = force_unicode(msg, encoding=encoding)
                 clsname = force_unicode(ev.__class__.__name__,
                         encoding=encoding)
-                ev = u'%s: %s' % (clsname, msg)
-        elif not isinstance(ev, unicode):
+                ev = '%s: %s' % (clsname, msg)
+        elif not isinstance(ev, str):
             ev = repr(ev)
 
         return force_unicode(ev, encoding=encoding)
--- nose/result.py	(original)
+++ nose/result.py	(refactored)
@@ -62,7 +62,7 @@
         except TypeError:
             # 2.3 compat
             exc_info = self._exc_info_to_string(err)
-        for cls, (storage, label, isfail) in self.errorClasses.items():
+        for cls, (storage, label, isfail) in list(self.errorClasses.items()):
             #if 'Skip' in cls.__name__ or 'Skip' in ec.__name__:
             #    from nose.tools import set_trace
             #    set_trace()
@@ -101,7 +101,7 @@
         """Overrides to print all errorClasses errors as well.
         """
         _TextTestResult.printErrors(self)
-        for cls in self.errorClasses.keys():
+        for cls in list(self.errorClasses.keys()):
             storage, label, isfail = self.errorClasses[cls]
             if isfail:
                 self.printErrorList(label, storage)
@@ -124,7 +124,7 @@
         writeln()
 
         summary = {}
-        eckeys = self.errorClasses.keys()
+        eckeys = list(self.errorClasses.keys())
         for cls in eckeys:
             storage, label, isfail = self.errorClasses[cls]
             count = len(storage)
@@ -140,7 +140,7 @@
             write("FAILED")
         else:
             write("OK")
-        items = summary.items()
+        items = list(summary.items())
         if items:
             items.sort()
             write(" (")
@@ -157,7 +157,7 @@
         """
         if self.errors or self.failures:
             return False
-        for cls in self.errorClasses.keys():
+        for cls in list(self.errorClasses.keys()):
             storage, label, isfail = self.errorClasses[cls]
             if not isfail:
                 continue
--- nose/selector.py	(original)
+++ nose/selector.py	(refactored)
@@ -52,11 +52,9 @@
         """
         return ((self.match.search(name)
                  or (self.include and
-                     filter(None,
-                            [inc.search(name) for inc in self.include])))
+                     [_f for _f in [inc.search(name) for inc in self.include] if _f]))
                 and ((not self.exclude)
-                     or not filter(None,
-                                   [exc.search(name) for exc in self.exclude])
+                     or not [_f for _f in [exc.search(name) for exc in self.exclude] if _f]
                  ))
     
     def wantClass(self, cls):
@@ -89,9 +87,7 @@
         tail = op_basename(dirname)
         if ispackage(dirname):
RefactoringTool: Refactored nose/suite.py
RefactoringTool: Refactored nose/twistedtools.py
RefactoringTool: Refactored nose/util.py
RefactoringTool: No changes to nose/ext/__init__.py
RefactoringTool: Refactored nose/ext/dtcompat.py
             wanted = (not self.exclude
-                      or not filter(None,
-                                    [exc.search(tail) for exc in self.exclude]
-                                    ))
+                      or not [_f for _f in [exc.search(tail) for exc in self.exclude] if _f])
         else:
             wanted = (self.matches(tail)
                       or (self.config.srcDirs
--- nose/suite.py	(original)
+++ nose/suite.py	(refactored)
@@ -7,7 +7,7 @@
 functions or methods) for the context that contains its tests.
 
 """
-from __future__ import generators
+
 
 import logging
 import sys
@@ -75,14 +75,14 @@
             test(result)
         return result
 
-    def __nonzero__(self):
+    def __bool__(self):
         log.debug("tests in %s?", id(self))
         if self._precache:
             return True
         if self.test_generator is None:
             return False
         try:
-            test = self.test_generator.next()
+            test = next(self.test_generator)
             if test is not None:
                 self._precache.append(test)
                 return True
@@ -439,7 +439,7 @@
         # don't want that, instead want the module the class is in now
         # (classes are re-ancestored elsewhere).
         if hasattr(context, 'im_class'):
-            context = context.im_class
+            context = context.__self__.__class__
         elif hasattr(context, '__self__'):
             context = context.__self__.__class__
         if hasattr(context, '__module__'):
--- nose/twistedtools.py	(original)
+++ nose/twistedtools.py	(refactored)
@@ -29,7 +29,7 @@
 """
 
 import sys
-from Queue import Queue, Empty
+from queue import Queue, Empty
 from nose.tools import make_decorator, TimeExpired
 
 __all__ = [
@@ -166,7 +166,7 @@
             # Re-raise all exceptions
             if error is not None:
                 exc_type, exc_value, tb = error
-                raise exc_type, exc_value, tb
+                raise exc_type(exc_value).with_traceback(tb)
         wrapper = make_decorator(func)(wrapper)
         return wrapper
     return decorate
--- nose/util.py	(original)
+++ nose/util.py	(refactored)
@@ -151,7 +151,7 @@
         return func.compat_co_firstlineno
     except AttributeError:
         try:
-            return func.func_code.co_firstlineno
+            return func.__code__.co_firstlineno
         except AttributeError:
             return -1
 
@@ -400,7 +400,7 @@
         file = getattr(test, '__file__', None)
         module = getattr(test, '__name__', None)
         return (src(file), module, call)
-    if t == types.FunctionType or issubclass(t, type) or t == types.ClassType:
+    if t == types.FunctionType or issubclass(t, type) or t == type:
         module = getattr(test, '__module__', None)
         if module is not None:
             m = sys.modules[module]
@@ -410,7 +410,7 @@
         call = getattr(test, '__name__', None)
         return (src(file), module, call)
     if t == types.MethodType:
-        cls_adr = test_address(test.im_class)
+        cls_adr = test_address(test.__self__.__class__)
         return (src(cls_adr[0]), cls_adr[1],
                 "%s.%s" % (cls_adr[2], test.__name__))
     # handle unittest.TestCase instances
@@ -454,7 +454,7 @@
                         bl = set([inspect.Parameter.VAR_KEYWORD,
                                   inspect.Parameter.VAR_POSITIONAL,
                                   inspect.Parameter.KEYWORD_ONLY])
-                        args = [k for k, v in sig.parameters.items()
+                        args = [k for k, v in list(sig.parameters.items())
                                 if v.kind not in bl]
                     except AttributeError:
                         args, varargs, varkw, defaults = \
@@ -470,7 +470,7 @@
                             bl = set([inspect.Parameter.VAR_KEYWORD,
                                       inspect.Parameter.VAR_POSITIONAL,
                                       inspect.Parameter.KEYWORD_ONLY])
-                            args = [k for k, v in sig.parameters.items()
+                            args = [k for k, v in list(sig.parameters.items())
                                     if v.kind not in bl]
 
                         except AttributeError:
@@ -570,7 +570,7 @@
             self._keys.append(key)
 
     def __str__(self):
-        return "{%s}" % ', '.join(["%r: %r" % (k, v) for k, v in self.items()])
+        return "{%s}" % ', '.join(["%r: %r" % (k, v) for k, v in list(self.items())])
 
     def clear(self):
         super(odict, self).clear()
@@ -582,7 +582,7 @@
         return d
 
     def items(self):
-        return zip(self._keys, self.values())
+        return list(zip(self._keys, list(self.values())))
 
     def keys(self):
         return self._keys[:]
@@ -595,12 +595,12 @@
 
     def update(self, dict):
         super(odict, self).update(dict)
-        for key in dict.keys():
+        for key in list(dict.keys()):
             if key not in self._keys:
                 self._keys.append(key)
 
     def values(self):
-        return map(self.get, self._keys)
+        return list(map(self.get, self._keys))
 
 
 def transplant_func(func, module):
@@ -672,7 +672,7 @@
         if isinstance(val, Exception):
             return ' '.join([safe_str(arg, encoding)
                              for arg in val])
-        return unicode(val).encode(encoding)
+        return str(val).encode(encoding)
 
 
 def is_executable(file):
--- nose/ext/dtcompat.py	(original)
+++ nose/ext/dtcompat.py	(refactored)
@@ -104,7 +104,7 @@
 import sys, traceback, inspect, linecache, os, re
 import unittest, difflib, pdb, tempfile
 import warnings
-from StringIO import StringIO
+from io import StringIO
 
 # Don't whine about the deprecated is_private function in this
 # module's tests.
@@ -219,7 +219,7 @@
     """
     if inspect.ismodule(module):
         return module
-    elif isinstance(module, (str, unicode)):
+    elif isinstance(module, str):
         return __import__(module, globals(), locals(), ["*"])
     elif module is None:
         return sys.modules[sys._getframe(depth).f_globals['__name__']]
@@ -341,9 +341,9 @@
 # [XX] Normalize with respect to os.path.pardir?
 def _module_relative_path(module, path):
     if not inspect.ismodule(module):
-        raise TypeError, 'Expected a module: %r' % module
+        raise TypeError('Expected a module: %r' % module)
     if path.startswith('/'):
-        raise ValueError, 'Module-relative files may not have absolute paths'
+        raise ValueError('Module-relative files may not have absolute paths')
 
     # Find the base directory for the path.
     if hasattr(module, '__file__'):
@@ -457,7 +457,7 @@
         Create a new DocTest containing the given examples.  The
         DocTest's globals are initialized with a copy of `globs`.
         """
-        assert not isinstance(examples, basestring), \
+        assert not isinstance(examples, str), \
                "DocTest no longer accepts str; use DocTestParser instead"
         self.examples = examples
         self.docstring = docstring
@@ -856,7 +856,7 @@
         if module is None:
             return True
         elif inspect.isfunction(object):
-            return module.__dict__ is object.func_globals
+            return module.__dict__ is object.__globals__
         elif inspect.isclass(object):
             # Some jython classes don't set __module__
             return module.__name__ == getattr(object, '__module__', None)
@@ -875,7 +875,7 @@
         add them to `tests`.
         """
         if self._verbose:
-            print 'Finding tests in %s' % name
+            print('Finding tests in %s' % name)
 
         # If we've already processed this object, then ignore it.
         if id(obj) in seen:
@@ -889,7 +889,7 @@
 
         # Look for tests in a module's contained objects.
         if inspect.ismodule(obj) and self._recurse:
-            for valname, val in obj.__dict__.items():
+            for valname, val in list(obj.__dict__.items()):
                 # Check if this contained object should be ignored.
                 if self._filter(val, name, valname):
RefactoringTool: No changes to nose/plugins/__init__.py
RefactoringTool: No changes to nose/plugins/allmodules.py
RefactoringTool: Refactored nose/plugins/attrib.py
                     continue
@@ -902,14 +902,14 @@
 
         # Look for tests in a module's __test__ dictionary.
         if inspect.ismodule(obj) and self._recurse:
-            for valname, val in getattr(obj, '__test__', {}).items():
-                if not isinstance(valname, basestring):
+            for valname, val in list(getattr(obj, '__test__', {}).items()):
+                if not isinstance(valname, str):
                     raise ValueError("DocTestFinder.find: __test__ keys "
                                      "must be strings: %r" %
                                      (type(valname),))
                 if not (inspect.isfunction(val) or inspect.isclass(val) or
                         inspect.ismethod(val) or inspect.ismodule(val) or
-                        isinstance(val, basestring)):
+                        isinstance(val, str)):
                     raise ValueError("DocTestFinder.find: __test__ values "
                                      "must be strings, functions, methods, "
                                      "classes, or modules: %r" %
@@ -920,7 +920,7 @@
 
         # Look for tests in a class's contained objects.
         if inspect.isclass(obj) and self._recurse:
-            for valname, val in obj.__dict__.items():
+            for valname, val in list(obj.__dict__.items()):
                 # Check if this contained object should be ignored.
                 if self._filter(val, name, valname):
                     continue
@@ -928,7 +928,7 @@
                 if isinstance(val, staticmethod):
                     val = getattr(obj, valname)
                 if isinstance(val, classmethod):
-                    val = getattr(obj, valname).im_func
+                    val = getattr(obj, valname).__func__
 
                 # Recurse to methods, properties, and nested classes.
                 if ((inspect.isfunction(val) or inspect.isclass(val) or
@@ -945,7 +945,7 @@
         """
         # Extract the object's docstring.  If it doesn't have one,
         # then return None (no test for this object).
-        if isinstance(obj, basestring):
+        if isinstance(obj, str):
             docstring = obj
         else:
             try:
@@ -953,7 +953,7 @@
                     docstring = ''
                 else:
                     docstring = obj.__doc__
-                    if not isinstance(docstring, basestring):
+                    if not isinstance(docstring, str):
                         docstring = str(docstring)
             except (TypeError, AttributeError):
                 docstring = ''
@@ -1003,8 +1003,8 @@
                     break
 
         # Find the line number for functions & methods.
-        if inspect.ismethod(obj): obj = obj.im_func
-        if inspect.isfunction(obj): obj = obj.func_code
+        if inspect.ismethod(obj): obj = obj.__func__
+        if inspect.isfunction(obj): obj = obj.__code__
         if inspect.istraceback(obj): obj = obj.tb_frame
         if inspect.isframe(obj): obj = obj.f_code
         if inspect.iscode(obj):
@@ -1143,7 +1143,7 @@
         # to modify them).
         original_optionflags = self.optionflags
 
-        SUCCESS, FAILURE, BOOM = range(3) # `outcome` state
+        SUCCESS, FAILURE, BOOM = list(range(3)) # `outcome` state
 
         check = self._checker.check_output
 
@@ -1158,7 +1158,7 @@
             # Merge in the example's options.
             self.optionflags = original_optionflags
             if example.options:
-                for (optionflag, val) in example.options.items():
+                for (optionflag, val) in list(example.options.items()):
                     if val:
                         self.optionflags |= optionflag
                     else:
@@ -1179,8 +1179,8 @@
             # keyboard interrupts.)
             try:
                 # Don't blink!  This is where the user's code gets run.
-                exec compile(example.source, filename, "single",
-                             compileflags, 1) in test.globs
+                exec(compile(example.source, filename, "single",
+                             compileflags, 1), test.globs)
                 self.debugger.set_continue() # ==== Example Finished ====
                 exception = None
             except KeyboardInterrupt:
@@ -1341,7 +1341,7 @@
         passed = []
         failed = []
         totalt = totalf = 0
-        for x in self._name2ft.items():
+        for x in list(self._name2ft.items()):
             name, (f, t) = x
             assert f <= t
             totalt += t
@@ -1354,28 +1354,28 @@
                 failed.append(x)
         if verbose:
             if notests:
-                print len(notests), "items had no tests:"
+                print(len(notests), "items had no tests:")
                 notests.sort()
                 for thing in notests:
-                    print "   ", thing
+                    print("   ", thing)
             if passed:
-                print len(passed), "items passed all tests:"
+                print(len(passed), "items passed all tests:")
                 passed.sort()
                 for thing, count in passed:
-                    print " %3d tests in %s" % (count, thing)
+                    print(" %3d tests in %s" % (count, thing))
         if failed:
-            print self.DIVIDER
-            print len(failed), "items had failures:"
+            print(self.DIVIDER)
+            print(len(failed), "items had failures:")
             failed.sort()
             for thing, (f, t) in failed:
-                print " %3d of %3d in %s" % (f, t, thing)
+                print(" %3d of %3d in %s" % (f, t, thing))
         if verbose:
-            print totalt, "tests in", len(self._name2ft), "items."
-            print totalt - totalf, "passed and", totalf, "failed."
+            print(totalt, "tests in", len(self._name2ft), "items.")
+            print(totalt - totalf, "passed and", totalf, "failed.")
         if totalf:
-            print "***Test Failed***", totalf, "failures."
+            print("***Test Failed***", totalf, "failures.")
         elif verbose:
-            print "Test passed."
+            print("Test passed.")
         return totalf, totalt
 
     #/////////////////////////////////////////////////////////////////
@@ -1383,10 +1383,10 @@
     #/////////////////////////////////////////////////////////////////
     def merge(self, other):
         d = self._name2ft
-        for name, (f, t) in other._name2ft.items():
+        for name, (f, t) in list(other._name2ft.items()):
             if name in d:
-                print "*** DocTestRunner.merge: '" + name + "' in both" \
-                    " testers; summing outcomes."
+                print("*** DocTestRunner.merge: '" + name + "' in both" \
+                    " testers; summing outcomes.")
                 f2, t2 = d[name]
                 f = f + f2
                 t = t + t2
@@ -1875,10 +1875,10 @@
     def runstring(self, s, name):
         test = DocTestParser().get_doctest(s, self.globs, name, None, None)
         if self.verbose:
-            print "Running string", name
+            print("Running string", name)
         (f,t) = self.testrunner.run(test)
         if self.verbose:
-            print f, "of", t, "examples failed in string", name
+            print(f, "of", t, "examples failed in string", name)
         return (f,t)
 
     def rundoc(self, object, name=None, module=None):
@@ -2245,9 +2245,9 @@
 
         if pm:
             try:
-                execfile(srcfilename, globs, globs)
+                exec(compile(open(srcfilename, "rb").read(), srcfilename, 'exec'), globs, globs)
             except:
-                print sys.exc_info()[1]
+                print(sys.exc_info()[1])
                 pdb.post_mortem(sys.exc_info()[2])
         else:
             # Note that %r is vital here.  '%s' instead can, e.g., cause
--- nose/plugins/attrib.py	(original)
+++ nose/plugins/attrib.py	(refactored)
@@ -118,7 +118,7 @@
     def wrap_ob(ob):
         for name in args:
             setattr(ob, name, True)
-        for name, value in kwargs.iteritems():
+        for name, value in kwargs.items():
RefactoringTool: Refactored nose/plugins/base.py
RefactoringTool: No changes to nose/plugins/builtin.py
RefactoringTool: Refactored nose/plugins/capture.py
RefactoringTool: No changes to nose/plugins/collect.py
RefactoringTool: Refactored nose/plugins/cover.py
RefactoringTool: No changes to nose/plugins/debug.py
RefactoringTool: No changes to nose/plugins/deprecated.py
RefactoringTool: Refactored nose/plugins/doctests.py
RefactoringTool: Refactored nose/plugins/errorclass.py
             setattr(ob, name, value)
         return ob
     return wrap_ob
@@ -280,7 +280,7 @@
         """Accept the method if its attributes match.
         """
         try:
-            cls = method.im_class
+            cls = method.__self__.__class__
         except AttributeError:
             return False
         return self.validateAttrib(method, cls)
--- nose/plugins/base.py	(original)
+++ nose/plugins/base.py	(refactored)
@@ -67,7 +67,7 @@
         try:
             self.options(parser, env)
             self.can_configure = True
-        except OptionConflictError, e:
+        except OptionConflictError as e:
             warn("Plugin %s has conflicting option string: %s and will "
                  "be disabled" % (self, e), RuntimeWarning)
             self.enabled = False
--- nose/plugins/capture.py	(original)
+++ nose/plugins/capture.py	(refactored)
@@ -16,7 +16,7 @@
 from nose.plugins.base import Plugin
 from nose.pyversion import exc_to_unicode, force_unicode
 from nose.util import ln
-from StringIO import StringIO
+from io import StringIO
 
 
 log = logging.getLogger(__name__)
@@ -111,17 +111,17 @@
         # from an exception raised while trying to get the captured output.
         ev = exc_to_unicode(ev)
         output = force_unicode(output)
-        error_text = [ev, ln(u'>> begin captured stdout <<'),
-                      output, ln(u'>> end captured stdout <<')]
+        error_text = [ev, ln('>> begin captured stdout <<'),
+                      output, ln('>> end captured stdout <<')]
         if output_exc_info:
-            error_text.extend([u'OUTPUT ERROR: Could not get captured output.',
+            error_text.extend(['OUTPUT ERROR: Could not get captured output.',
                                # <https://github.com/python/cpython/blob/2.7/Lib/StringIO.py#L258>
                                # <https://github.com/nose-devs/nose/issues/816>
-                               u"The test might've printed both 'unicode' strings and non-ASCII 8-bit 'str' strings.",
-                               ln(u'>> begin captured stdout exception traceback <<'),
-                               u''.join(traceback.format_exception(*output_exc_info)),
-                               ln(u'>> end captured stdout exception traceback <<')])
-        return u'\n'.join(error_text)
+                               "The test might've printed both 'unicode' strings and non-ASCII 8-bit 'str' strings.",
+                               ln('>> begin captured stdout exception traceback <<'),
+                               ''.join(traceback.format_exception(*output_exc_info)),
+                               ln('>> end captured stdout exception traceback <<')])
+        return '\n'.join(error_text)
 
     def start(self):
         self.stdout.append(sys.stdout)
--- nose/plugins/cover.py	(original)
+++ nose/plugins/cover.py	(refactored)
@@ -13,7 +13,7 @@
 import logging
 import re
 import sys
-import StringIO
+import io
 from nose.plugins.base import Plugin
 from nose.util import src, tolist
 
@@ -145,7 +145,7 @@
             self.coverInstance.exclude('#pragma[: ]+[nN][oO] [cC][oO][vV][eE][rR]')
 
             log.debug("Coverage begin")
-            self.skipModules = sys.modules.keys()[:]
+            self.skipModules = list(sys.modules.keys())[:]
             if self.coverErase:
                 log.debug("Clearing previously collected coverage statistics")
                 self.coverInstance.combine()
@@ -184,7 +184,7 @@
         self.coverInstance.combine()
         self.coverInstance.save()
         modules = [module
-                    for name, module in sys.modules.items()
+                    for name, module in list(sys.modules.items())
                     if self.wantModuleCoverage(name, module)]
         log.debug("Coverage report will cover modules: %s", modules)
         self.coverInstance.report(modules, file=stream, show_missing=True)
@@ -194,19 +194,19 @@
             log.debug("Generating HTML coverage report")
             try:
                 self.coverInstance.html_report(modules, self.coverHtmlDir)
-            except coverage.misc.CoverageException, e:
+            except coverage.misc.CoverageException as e:
                 log.warning("Failed to generate HTML report: %s" % str(e))
 
         if self.coverXmlFile:
             log.debug("Generating XML coverage report")
             try:
                 self.coverInstance.xml_report(modules, self.coverXmlFile)
-            except coverage.misc.CoverageException, e:
+            except coverage.misc.CoverageException as e:
                 log.warning("Failed to generate XML report: %s" % str(e))
 
         # make sure we have minimum required coverage
         if self.coverMinPercentage:
-            f = StringIO.StringIO()
+            f = io.StringIO()
             self.coverInstance.report(modules, file=f, show_missing=True)
 
             multiPackageRe = (r'-------\s\w+\s+\d+\s+\d+(?:\s+\d+\s+\d+)?'
--- nose/plugins/doctests.py	(original)
+++ nose/plugins/doctests.py	(refactored)
@@ -47,7 +47,7 @@
    additional documentation and examples.
 
 """
-from __future__ import generators
+
 
 import codecs
 import logging
@@ -60,11 +60,11 @@
 from nose.util import anyp, getpackage, test_address, resolve_name, \
      src, tolist, isproperty
 try:
-    from cStringIO import StringIO
+    from io import StringIO
 except ImportError:
-    from StringIO import StringIO
+    from io import StringIO
 import sys
-import __builtin__ as builtin_mod
+import builtins as builtin_mod
 
 log = logging.getLogger(__name__)
 
@@ -276,7 +276,7 @@
                 try:
                     fixture_context = __import__(
                         fixt_mod, globals(), locals(), ["nop"])
-                except ImportError, e:
+                except ImportError as e:
                     log.debug(
                         "Could not import %s: %s (%s)", fixt_mod, e, sys.path)
                 log.debug("Fixture module %s resolved to %s",
@@ -322,13 +322,11 @@
         # FIXME don't think we need include/exclude checks here?
         return ((self.doctest_tests or not self.conf.testMatch.search(name)
                  or (self.conf.include 
-                     and filter(None,
-                                [inc.search(name)
-                                 for inc in self.conf.include])))
+                     and [_f for _f in [inc.search(name)
+                                 for inc in self.conf.include] if _f]))
                 and (not self.conf.exclude 
-                     or not filter(None,
-                                   [exc.search(name)
-                                    for exc in self.conf.exclude])))
+                     or not [_f for _f in [exc.search(name)
+                                    for exc in self.conf.exclude] if _f]))
     
     def wantFile(self, file):
         """Override to select all modules and any file ending with
@@ -341,9 +339,8 @@
         if (self.extension
             and anyp(file.endswith, self.extension)
             and (not self.conf.exclude
-                 or not filter(None, 
-                               [exc.search(file)
-                                for exc in self.conf.exclude]))):
+                 or not [_f for _f in [exc.search(file)
+                                for exc in self.conf.exclude] if _f])):
             return True
         return None
 
@@ -414,7 +411,7 @@
         if value is None:
             return
         setattr(builtin_mod, self._result_var,  value)
-        print repr(value)
+        print(repr(value))
 
     def tearDown(self):
         super(DocTestCase, self).tearDown()
@@ -447,7 +444,7 @@
         if value is None:
             return
         setattr(builtin_mod, self._result_var, value)
-        print repr(value)
+        print(repr(value))
 
     def tearDown(self):
         super(DocFileCase, self).tearDown()
--- nose/plugins/errorclass.py	(original)
+++ nose/plugins/errorclass.py	(refactored)
@@ -103,7 +103,7 @@
     """
     def __init__(self, name, bases, attr):
         errorClasses = []
-        for name, detail in attr.items():
RefactoringTool: No changes to nose/plugins/failuredetail.py
RefactoringTool: Refactored nose/plugins/isolate.py
RefactoringTool: Refactored nose/plugins/logcapture.py
RefactoringTool: Refactored nose/plugins/manager.py
RefactoringTool: Refactored nose/plugins/multiprocess.py
RefactoringTool: Refactored nose/plugins/plugintest.py
RefactoringTool: No changes to nose/plugins/prof.py
RefactoringTool: No changes to nose/plugins/skip.py
RefactoringTool: Refactored nose/plugins/testid.py
+        for name, detail in list(attr.items()):
             if isinstance(detail, ErrorClass):
                 attr.pop(name)
                 for cls in detail:
@@ -127,12 +127,11 @@
         return iter(self.errorClasses)
 
 
-class ErrorClassPlugin(Plugin):
+class ErrorClassPlugin(Plugin, metaclass=MetaErrorClass):
     """
     Base class for ErrorClass plugins. Subclass this class and declare the
     exceptions that you wish to handle as attributes of the subclass.
     """
-    __metaclass__ = MetaErrorClass
     score = 1000
     errorClasses = ()
 
@@ -141,7 +140,7 @@
         if not isclass(err_cls):
             return
         classes = [e[0] for e in self.errorClasses]
-        if filter(lambda c: issubclass(err_cls, c), classes):
+        if [c for c in classes if issubclass(err_cls, c)]:
             return True
 
     def prepareTestResult(self, result):
--- nose/plugins/isolate.py	(original)
+++ nose/plugins/isolate.py	(refactored)
@@ -72,7 +72,7 @@
         it was in when mod stack was pushed.
         """
         mods = self._mod_stack.pop()
-        to_del = [ m for m in sys.modules.keys() if m not in mods ]
+        to_del = [ m for m in list(sys.modules.keys()) if m not in mods ]
         if to_del:
             log.debug('removing sys modules entries: %s', to_del)
             for mod in to_del:
--- nose/plugins/logcapture.py	(original)
+++ nose/plugins/logcapture.py	(refactored)
@@ -23,9 +23,9 @@
 from nose.util import anyp, ln, safe_str
 
 try:
-    from cStringIO import StringIO
+    from io import StringIO
 except ImportError:
-    from StringIO import StringIO
+    from io import StringIO
 
 log = logging.getLogger(__name__)
 
@@ -57,7 +57,7 @@
         any item in `matchers`"""
         def record_matches_key(key):
             return record == key or record.startswith(key + '.')
-        return anyp(bool, map(record_matches_key, matchers))
+        return anyp(bool, list(map(record_matches_key, matchers)))
     _any_match = staticmethod(_any_match)
 
     def _allow(self, record):
@@ -180,7 +180,7 @@
             if hasattr(root_logger, "handlers"):
                 for handler in root_logger.handlers:
                     root_logger.removeHandler(handler)
-            for logger in logging.Logger.manager.loggerDict.values():
+            for logger in list(logging.Logger.manager.loggerDict.values()):
                 if hasattr(logger, "handlers"):
                     for handler in logger.handlers:
                         logger.removeHandler(handler)
@@ -237,7 +237,7 @@
         return (ec, self.addCaptureToErr(ev, records), tb)
 
     def formatLogRecords(self):
-        return map(safe_str, self.handler.buffer)
+        return list(map(safe_str, self.handler.buffer))
 
     def addCaptureToErr(self, ev, records):
         return '\n'.join([safe_str(ev), ln('>> begin captured logging <<')] + \
--- nose/plugins/manager.py	(original)
+++ nose/plugins/manager.py	(refactored)
@@ -60,13 +60,13 @@
 from nose.pyversion import sort_list
 
 try:
-    import cPickle as pickle
+    import pickle as pickle
 except:
     import pickle
 try:
-    from cStringIO import StringIO
+    from io import StringIO
 except:
-    from StringIO import StringIO
+    from io import StringIO
 
 
 __all__ = ['DefaultPluginManager', 'PluginManager', 'EntryPointPluginManager',
@@ -109,7 +109,7 @@
                 bl = set([inspect.Parameter.VAR_KEYWORD,
                           inspect.Parameter.VAR_POSITIONAL,
                           inspect.Parameter.KEYWORD_ONLY])
-                args = [k for k, v in sig.parameters.items()
+                args = [k for k, v in list(sig.parameters.items())
                         if v.kind not in bl]
                 arg_len = len(args)
                 if hasattr(meth, '__self__'):
@@ -399,7 +399,7 @@
                     plugcls = ep.load()
                 except KeyboardInterrupt:
                     raise
-                except Exception, e:
+                except Exception as e:
                     # never want a plugin load to kill the test run
                     # but we can't log here because the logger is not yet
                     # configured
--- nose/plugins/multiprocess.py	(original)
+++ nose/plugins/multiprocess.py	(refactored)
@@ -115,12 +115,12 @@
     from unittest.runner import _WritelnDecorator
 except ImportError:
     from unittest import _WritelnDecorator
-from Queue import Empty
+from queue import Empty
 from warnings import warn
 try:
-    from cStringIO import StringIO
+    from io import StringIO
 except ImportError:
-    import StringIO
+    import io
 
 # this is a list of plugin classes that will be checked for and created inside 
 # each worker process
@@ -478,7 +478,7 @@
                                 self.config.multiprocess_timeout-timeprocessing)
             log.debug("Completed %s tasks (%s remain)", len(completed), len(tasks))
 
-        except (KeyboardInterrupt, SystemExit), e:
+        except (KeyboardInterrupt, SystemExit) as e:
             log.info('parent received ctrl-c when waiting for test results')
             thrownError = e
             #resultQueue.get(False)
@@ -633,7 +633,7 @@
         result.testsRun += testsRun
         result.failures.extend(failures)
         result.errors.extend(errors)
-        for key, (storage, label, isfail) in errorClasses.items():
+        for key, (storage, label, isfail) in list(errorClasses.items()):
             if key not in result.errorClasses:
                 # Ordinarily storage is result attribute
                 # but it's only processed through the errorClasses
@@ -688,7 +688,7 @@
         failures = [(TestLet(c), err) for c, err in result.failures]
         errors = [(TestLet(c), err) for c, err in result.errors]
         errorClasses = {}
-        for key, (storage, label, isfail) in result.errorClasses.items():
+        for key, (storage, label, isfail) in list(result.errorClasses.items()):
             errorClasses[key] = ([(TestLet(c), err) for c, err in storage],
                                  label, isfail)
         return (
@@ -715,7 +715,7 @@
             test(result)
             currentaddr.value = bytes_('')
             resultQueue.put((ix, test_addr, test.tasks, batch(result)))
-        except KeyboardInterrupt, e: #TimedOutException:
+        except KeyboardInterrupt as e: #TimedOutException:
             timeout = isinstance(e, TimedOutException)
             if timeout:
                 keyboardCaught.set()
@@ -810,7 +810,7 @@
                 #log.debug('running test %s in suite %s', test, self);
                 try:
                     test(orig)
-                except KeyboardInterrupt, e:
+                except KeyboardInterrupt as e:
                     timeout = isinstance(e, TimedOutException)
                     if timeout:
                         msg = 'Timeout when running test %s in suite %s'
--- nose/plugins/plugintest.py	(original)
+++ nose/plugins/plugintest.py	(refactored)
@@ -100,9 +100,9 @@
 from warnings import warn
 
 try:
-    from cStringIO import StringIO
+    from io import StringIO
 except ImportError:
-    from StringIO import StringIO
+    from io import StringIO
 
 __all__ = ['PluginTester', 'run']
 
@@ -135,7 +135,7 @@
         if getpid() != self.__master:
             return
 
-        from Queue import Empty
+        from queue import Empty
         from collections import defaultdict
         cache = defaultdict(str)
         while True:
@@ -404,7 +404,7 @@
             sys.stderr = stderr
             sys.stdout = stdout
     out = buffer.getvalue()
-    print munge_nose_output_for_doctest(out)
+    print(munge_nose_output_for_doctest(out))
 
 
 def run_buffered(*arg, **kw):
--- nose/plugins/testid.py	(original)
+++ nose/plugins/testid.py	(refactored)
@@ -100,7 +100,7 @@
 from nose.util import src, set
 
 try:
-    from cPickle import dump, load
+    from pickle import dump, load
 except ImportError:
     from pickle import dump, load
 
@@ -198,7 +198,7 @@
                 self.ids, self.tests, self.failed, self.source_names,
                 self.idfile)
             fh.close()
-        except ValueError, e:
RefactoringTool: Refactored nose/plugins/xunit.py
RefactoringTool: No changes to nose/sphinx/pluginopts.py
RefactoringTool: No changes to nose/tools/__init__.py
RefactoringTool: Refactored nose/tools/nontrivial.py
RefactoringTool: No changes to nose/tools/trivial.py
RefactoringTool: Files that were modified:
RefactoringTool: bin/nosetests
RefactoringTool: nose/__init__.py
RefactoringTool: nose/__main__.py
RefactoringTool: nose/case.py
RefactoringTool: nose/commands.py
RefactoringTool: nose/config.py
RefactoringTool: nose/core.py
RefactoringTool: nose/exc.py
RefactoringTool: nose/failure.py
RefactoringTool: nose/importer.py
RefactoringTool: nose/inspector.py
RefactoringTool: nose/loader.py
RefactoringTool: nose/proxy.py
RefactoringTool: nose/pyversion.py
RefactoringTool: nose/result.py
RefactoringTool: nose/selector.py
RefactoringTool: nose/suite.py
RefactoringTool: nose/twistedtools.py
RefactoringTool: nose/util.py
RefactoringTool: nose/ext/__init__.py
RefactoringTool: nose/ext/dtcompat.py
RefactoringTool: nose/plugins/__init__.py
RefactoringTool: nose/plugins/allmodules.py
RefactoringTool: nose/plugins/attrib.py
RefactoringTool: nose/plugins/base.py
RefactoringTool: nose/plugins/builtin.py
RefactoringTool: nose/plugins/capture.py
RefactoringTool: nose/plugins/collect.py
RefactoringTool: nose/plugins/cover.py
RefactoringTool: nose/plugins/debug.py
RefactoringTool: nose/plugins/deprecated.py
RefactoringTool: nose/plugins/doctests.py
RefactoringTool: nose/plugins/errorclass.py
RefactoringTool: nose/plugins/failuredetail.py
RefactoringTool: nose/plugins/isolate.py
RefactoringTool: nose/plugins/logcapture.py
RefactoringTool: nose/plugins/manager.py
RefactoringTool: nose/plugins/multiprocess.py
RefactoringTool: nose/plugins/plugintest.py
RefactoringTool: nose/plugins/prof.py
RefactoringTool: nose/plugins/skip.py
RefactoringTool: nose/plugins/testid.py
RefactoringTool: nose/plugins/xunit.py
RefactoringTool: nose/sphinx/pluginopts.py
RefactoringTool: nose/tools/__init__.py
RefactoringTool: nose/tools/nontrivial.py
RefactoringTool: nose/tools/trivial.py
+        except ValueError as e:
             # load() may throw a ValueError when reading the ids file, if it
             # was generated with a newer version of Python than we are currently
             # running.
--- nose/plugins/xunit.py	(original)
+++ nose/plugins/xunit.py	(refactored)
@@ -46,7 +46,7 @@
 import traceback
 import re
 import inspect
-from StringIO import StringIO
+from io import StringIO
 from time import time
 from xml.sax import saxutils
 
@@ -110,7 +110,7 @@
             result = str(exc)
         except UnicodeEncodeError:
             try:
-                result = unicode(exc)
+                result = str(exc)
             except UnicodeError:
                 # Fallback to args as neither str nor
                 # unicode(Exception(u'\xe6')) work in Python < 2.6
@@ -213,13 +213,13 @@
         self.stats['total'] = (self.stats['errors'] + self.stats['failures']
                                + self.stats['passes'] + self.stats['skipped'])
         self.error_report_file.write(
-            u'<?xml version="1.0" encoding="%(encoding)s"?>'
-            u'<testsuite name="%(testsuite_name)s" tests="%(total)d" '
-            u'errors="%(errors)d" failures="%(failures)d" '
-            u'skip="%(skipped)d">' % self.stats)
-        self.error_report_file.write(u''.join([force_unicode(e, self.encoding)
+            '<?xml version="1.0" encoding="%(encoding)s"?>'
+            '<testsuite name="%(testsuite_name)s" tests="%(total)d" '
+            'errors="%(errors)d" failures="%(failures)d" '
+            'skip="%(skipped)d">' % self.stats)
+        self.error_report_file.write(''.join([force_unicode(e, self.encoding)
                                                for e in self.errorlist]))
-        self.error_report_file.write(u'</testsuite>')
+        self.error_report_file.write('</testsuite>')
         self.error_report_file.close()
         if self.config.verbosity > 1:
             stream.writeln("-" * 70)
@@ -288,9 +288,9 @@
         id = test.id()
 
         self.errorlist.append(
-            u'<testcase classname=%(cls)s name=%(name)s time="%(taken).3f">'
-            u'<%(type)s type=%(errtype)s message=%(message)s><![CDATA[%(tb)s]]>'
-            u'</%(type)s>%(systemout)s%(systemerr)s</testcase>' %
+            '<testcase classname=%(cls)s name=%(name)s time="%(taken).3f">'
+            '<%(type)s type=%(errtype)s message=%(message)s><![CDATA[%(tb)s]]>'
+            '</%(type)s>%(systemout)s%(systemerr)s</testcase>' %
             {'cls': self._quoteattr(id_split(id)[0]),
              'name': self._quoteattr(id_split(id)[-1]),
              'taken': taken,
@@ -311,9 +311,9 @@
         id = test.id()
 
         self.errorlist.append(
-            u'<testcase classname=%(cls)s name=%(name)s time="%(taken).3f">'
-            u'<failure type=%(errtype)s message=%(message)s><![CDATA[%(tb)s]]>'
-            u'</failure>%(systemout)s%(systemerr)s</testcase>' %
+            '<testcase classname=%(cls)s name=%(name)s time="%(taken).3f">'
+            '<failure type=%(errtype)s message=%(message)s><![CDATA[%(tb)s]]>'
+            '</failure>%(systemout)s%(systemerr)s</testcase>' %
             {'cls': self._quoteattr(id_split(id)[0]),
              'name': self._quoteattr(id_split(id)[-1]),
              'taken': taken,
--- nose/tools/nontrivial.py	(original)
+++ nose/tools/nontrivial.py	(refactored)
@@ -26,7 +26,7 @@
         newfunc.__doc__ = func.__doc__
         newfunc.__module__ = func.__module__
         if not hasattr(newfunc, 'compat_co_firstlineno'):
-            newfunc.compat_co_firstlineno = func.func_code.co_firstlineno
+            newfunc.compat_co_firstlineno = func.__code__.co_firstlineno
         try:
             newfunc.__name__ = name
         except TypeError:
>>> py3-nose: Entering fakeroot...
/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
no previously-included directories found matching 'doc/.build'
>>> py3-nose-doc*: Running split function doc...
>>> py3-nose-doc*: Preparing subpackage py3-nose-doc...
>>> py3-nose-doc*: Running postcheck for py3-nose-doc
>>> py3-nose-pyc*: Running split function pyc...
'/home/buildozer/aports/community/py3-nose/pkg/py3-nose/usr/lib/python3.11/site-packages/nose/plugins/__pycache__' -> '/home/buildozer/aports/community/py3-nose/pkg/py3-nose-pyc/usr/lib/python3.11/site-packages/nose/plugins/__pycache__'
'/home/buildozer/aports/community/py3-nose/pkg/py3-nose/usr/lib/python3.11/site-packages/nose/__pycache__' -> '/home/buildozer/aports/community/py3-nose/pkg/py3-nose-pyc/usr/lib/python3.11/site-packages/nose/__pycache__'
'/home/buildozer/aports/community/py3-nose/pkg/py3-nose/usr/lib/python3.11/site-packages/nose/ext/__pycache__' -> '/home/buildozer/aports/community/py3-nose/pkg/py3-nose-pyc/usr/lib/python3.11/site-packages/nose/ext/__pycache__'
'/home/buildozer/aports/community/py3-nose/pkg/py3-nose/usr/lib/python3.11/site-packages/nose/tools/__pycache__' -> '/home/buildozer/aports/community/py3-nose/pkg/py3-nose-pyc/usr/lib/python3.11/site-packages/nose/tools/__pycache__'
'/home/buildozer/aports/community/py3-nose/pkg/py3-nose/usr/lib/python3.11/site-packages/nose/sphinx/__pycache__' -> '/home/buildozer/aports/community/py3-nose/pkg/py3-nose-pyc/usr/lib/python3.11/site-packages/nose/sphinx/__pycache__'
>>> py3-nose-pyc*: Preparing subpackage py3-nose-pyc...
>>> py3-nose-pyc*: Running postcheck for py3-nose-pyc
>>> py3-nose*: Running postcheck for py3-nose
>>> py3-nose*: Preparing package py3-nose...
>>> py3-nose-doc*: Tracing dependencies...
>>> py3-nose-doc*: Package size: 28.0 KB
>>> py3-nose-doc*: Compressing data...
>>> py3-nose-doc*: Create checksum...
>>> py3-nose-doc*: Create py3-nose-doc-1.3.7-r11.apk
>>> py3-nose-pyc*: Tracing dependencies...
	python3
	python3~3.11
>>> py3-nose-pyc*: Package size: 776.0 KB
>>> py3-nose-pyc*: Compressing data...
>>> py3-nose-pyc*: Create checksum...
>>> py3-nose-pyc*: Create py3-nose-pyc-1.3.7-r11.apk
>>> py3-nose*: Tracing dependencies...
	python3
	python3~3.11
>>> py3-nose*: Package size: 672.0 KB
>>> py3-nose*: Compressing data...
>>> py3-nose*: Create checksum...
>>> py3-nose*: Create py3-nose-1.3.7-r11.apk
>>> py3-nose: Build complete at Mon, 23 Oct 2023 05:45:08 +0000 elapsed time 0h 0m 23s
>>> py3-nose: Cleaning up srcdir
>>> py3-nose: Cleaning up pkgdir
>>> py3-nose: Uninstalling dependencies...
(1/19) Purging .makedepends-py3-nose (20231023.054501)
(2/19) Purging py3-setuptools-pyc (68.2.2-r0)
(3/19) Purging py3-setuptools (68.2.2-r0)
(4/19) Purging py3-packaging-pyc (23.2-r0)
(5/19) Purging py3-packaging (23.2-r0)
(6/19) Purging py3-parsing-pyc (3.1.1-r0)
(7/19) Purging py3-parsing (3.1.1-r0)
(8/19) Purging python3-pyc (3.11.6-r1)
(9/19) Purging python3-pycache-pyc0 (3.11.6-r1)
(10/19) Purging pyc (3.11.6-r1)
(11/19) Purging python3 (3.11.6-r1)
(12/19) Purging gdbm (1.23-r1)
(13/19) Purging libbz2 (1.0.8-r6)
(14/19) Purging libffi (3.4.4-r3)
(15/19) Purging libpanelw (6.4_p20231007-r0)
(16/19) Purging mpdecimal (2.5.1-r2)
(17/19) Purging readline (8.2.1-r2)
(18/19) Purging sqlite-libs (3.43.2-r0)
(19/19) Purging xz-libs (5.4.4-r0)
Executing busybox-1.36.1-r13.trigger
OK: 376 MiB in 102 packages
>>> py3-nose: Updating the community/x86 repository index...
>>> py3-nose: Signing the index...