Mock Version: 2.0 Mock Version: 2.0 Mock Version: 2.0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/python-google-apputils.spec'], chrootPath='/var/lib/mock/1258710-epel-8-x86_64-1582841661.421849/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'}shell=Falselogger=timeout=0uid=1001gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=TrueprintOutput=True) ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/python-google-apputils.spec'], chrootPath='/var/lib/mock/1258710-epel-8-x86_64-1582841661.421849/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'}shell=Falselogger=timeout=0uid=1001gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=TrueprintOutput=True) Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', 'b4da04bb74c947ce9aaf8854347071ab', '-D', '/var/lib/mock/1258710-epel-8-x86_64-1582841661.421849/root', '-a', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=en_US.UTF-8', '-u', 'mockbuild', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/python-google-apputils.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'} and shell False Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', 'b4da04bb74c947ce9aaf8854347071ab', '-D', '/var/lib/mock/1258710-epel-8-x86_64-1582841661.421849/root', '-a', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=en_US.UTF-8', '-u', 'mockbuild', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/python-google-apputils.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'} and shell False Building target platforms: x86_64 Building target platforms: x86_64 Building for target x86_64 Building for target x86_64 Wrote: /builddir/build/SRPMS/python-google-apputils-0.4.2-16.el8.src.rpm Wrote: /builddir/build/SRPMS/python-google-apputils-0.4.2-16.el8.src.rpm Child return code was: 0 Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/python-google-apputils.spec'], chrootPath='/var/lib/mock/1258710-epel-8-x86_64-1582841661.421849/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'}shell=Falselogger=timeout=0uid=1001gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=TrueprintOutput=True) ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/python-google-apputils.spec'], chrootPath='/var/lib/mock/1258710-epel-8-x86_64-1582841661.421849/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'}shell=Falselogger=timeout=0uid=1001gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11']unshare_net=TrueprintOutput=True) Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Using nspawn with args ['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11'] Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '38a8fffa42cd4f0fae4e2408e0f00134', '-D', '/var/lib/mock/1258710-epel-8-x86_64-1582841661.421849/root', '-a', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=en_US.UTF-8', '-u', 'mockbuild', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/python-google-apputils.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'} and shell False Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '38a8fffa42cd4f0fae4e2408e0f00134', '-D', '/var/lib/mock/1258710-epel-8-x86_64-1582841661.421849/root', '-a', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.eynsih5q:/etc/resolv.conf', '--bind=/dev/loop-control', '--bind=/dev/loop0', '--bind=/dev/loop1', '--bind=/dev/loop2', '--bind=/dev/loop3', '--bind=/dev/loop4', '--bind=/dev/loop5', '--bind=/dev/loop6', '--bind=/dev/loop7', '--bind=/dev/loop8', '--bind=/dev/loop9', '--bind=/dev/loop10', '--bind=/dev/loop11', '--console=pipe', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;\\007"', '--setenv=PS1= \\s-\\v\\$ ', '--setenv=LANG=en_US.UTF-8', '-u', 'mockbuild', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/python-google-apputils.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'en_US.UTF-8'} and shell False Building target platforms: x86_64 Building target platforms: x86_64 Building for target x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.vV46aO Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.vV46aO + umask 022 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf python-google-apputils-0.4.2 + rm -rf python-google-apputils-0.4.2 + /usr/bin/mkdir -p python-google-apputils-0.4.2 + /usr/bin/mkdir -p python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + /usr/bin/tar -xof - + /usr/bin/tar -xof - + /usr/bin/gzip -dc /builddir/build/SOURCES/google-apputils-0.4.2.tar.gz + /usr/bin/gzip -dc /builddir/build/SOURCES/google-apputils-0.4.2.tar.gz + STATUS=0 + STATUS=0 + '[' 0 -ne 0 ']' + '[' 0 -ne 0 ']' + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + mv google-apputils-0.4.2 python2 + mv google-apputils-0.4.2 python2 + find -name '*.py' + find -name '*.py' + xargs sed -i '/^#!\/usr\/bin\/.*python/d' + xargs sed -i '/^#!\/usr\/bin\/.*python/d' + sed -i -e 's/pytz>.*"/pytz"/' python2/setup.py + sed -i -e 's/pytz>.*"/pytz"/' python2/setup.py + cp -a python2 python3 + cp -a python2 python3 + 2to3 --write --nobackups python3 + 2to3 --write --nobackups python3 RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: Refactored python3/ez_setup.py RefactoringTool: Refactored python3/ez_setup.py RefactoringTool: No changes to python3/setup.py RefactoringTool: No changes to python3/setup.py RefactoringTool: No changes to python3/google/__init__.py RefactoringTool: No changes to python3/google/__init__.py RefactoringTool: No changes to python3/google/apputils/__init__.py RefactoringTool: No changes to python3/google/apputils/__init__.py RefactoringTool: Refactored python3/google/apputils/app.py RefactoringTool: Refactored python3/google/apputils/app.py RefactoringTool: Refactored python3/google/apputils/appcommands.py RefactoringTool: Refactored python3/google/apputils/appcommands.py RefactoringTool: Refactored python3/google/apputils/basetest.py RefactoringTool: Refactored python3/google/apputils/basetest.py --- python3/ez_setup.py (original) --- python3/ez_setup.py (original) +++ python3/ez_setup.py (refactored) +++ python3/ez_setup.py (refactored) @@ -42,10 +42,10 @@ @@ -42,10 +42,10 @@ if egg_name in md5_data: if egg_name in md5_data: digest = md5(data).hexdigest() digest = md5(data).hexdigest() if digest != md5_data[egg_name]: if digest != md5_data[egg_name]: - print >>sys.stderr, ( - print >>sys.stderr, ( + print(( + print(( "md5 validation of %s failed! (Possible download problem?)" "md5 validation of %s failed! (Possible download problem?)" % egg_name % egg_name - ) - ) + ), file=sys.stderr) + ), file=sys.stderr) sys.exit(2) sys.exit(2) return data return data @@ -75,14 +75,14 @@ @@ -75,14 +75,14 @@ return do_download() return do_download() try: try: pkg_resources.require("setuptools>="+version); return pkg_resources.require("setuptools>="+version); return - except pkg_resources.VersionConflict, e: - except pkg_resources.VersionConflict, e: + except pkg_resources.VersionConflict as e: + except pkg_resources.VersionConflict as e: if was_imported: if was_imported: - print >>sys.stderr, ( - print >>sys.stderr, ( + print(( + print(( "The required version of setuptools (>=%s) is not available, and\n" "The required version of setuptools (>=%s) is not available, and\n" "can't be installed while this script is running. Please install\n" "can't be installed while this script is running. Please install\n" " a more recent version first, using 'easy_install -U setuptools'." " a more recent version first, using 'easy_install -U setuptools'." "\n\n(Currently using %r)" "\n\n(Currently using %r)" - ) % (version, e.args[0]) - ) % (version, e.args[0]) + ) % (version, e.args[0]), file=sys.stderr) + ) % (version, e.args[0]), file=sys.stderr) sys.exit(2) sys.exit(2) except pkg_resources.DistributionNotFound: except pkg_resources.DistributionNotFound: pass pass @@ -101,7 +101,7 @@ @@ -101,7 +101,7 @@ with a '/'). `to_dir` is the directory where the egg will be downloaded. with a '/'). `to_dir` is the directory where the egg will be downloaded. `delay` is the number of seconds to pause before an actual download attempt. `delay` is the number of seconds to pause before an actual download attempt. """ """ - import urllib2, shutil - import urllib2, shutil + import urllib.request, urllib.error, urllib.parse, shutil + import urllib.request, urllib.error, urllib.parse, shutil egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) url = download_base + egg_name url = download_base + egg_name saveto = os.path.join(to_dir, egg_name) saveto = os.path.join(to_dir, egg_name) @@ -127,7 +127,7 @@ @@ -127,7 +127,7 @@ version, download_base, delay, url version, download_base, delay, url ); from time import sleep; sleep(delay) ); from time import sleep; sleep(delay) log.warn("Downloading %s", url) log.warn("Downloading %s", url) - src = urllib2.urlopen(url) - src = urllib2.urlopen(url) + src = urllib.request.urlopen(url) + src = urllib.request.urlopen(url) # Read/write all in one block, so we don't create a corrupt file # Read/write all in one block, so we don't create a corrupt file # if the download is interrupted. # if the download is interrupted. data = _validate_md5(egg_name, src.read()) data = _validate_md5(egg_name, src.read()) @@ -188,10 +188,10 @@ @@ -188,10 +188,10 @@ os.unlink(egg) os.unlink(egg) else: else: if setuptools.__version__ == '0.0.1': if setuptools.__version__ == '0.0.1': - print >>sys.stderr, ( - print >>sys.stderr, ( + print(( + print(( "You have an obsolete version of setuptools installed. Please\n" "You have an obsolete version of setuptools installed. Please\n" "remove it from your system entirely before rerunning this script." "remove it from your system entirely before rerunning this script." - ) - ) + ), file=sys.stderr) + ), file=sys.stderr) sys.exit(2) sys.exit(2) req = "setuptools>="+version req = "setuptools>="+version @@ -210,8 +210,8 @@ @@ -210,8 +210,8 @@ from setuptools.command.easy_install import main from setuptools.command.easy_install import main main(argv) main(argv) else: else: - print "Setuptools version",version,"or greater has been installed." - print "Setuptools version",version,"or greater has been installed." - print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' - print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' + print("Setuptools version",version,"or greater has been installed.") + print("Setuptools version",version,"or greater has been installed.") + print('(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)') + print('(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)') def update_md5(filenames): def update_md5(filenames): """Update our built-in md5 registry""" """Update our built-in md5 registry""" @@ -224,7 +224,7 @@ @@ -224,7 +224,7 @@ md5_data[base] = md5(f.read()).hexdigest() md5_data[base] = md5(f.read()).hexdigest() f.close() f.close() - data = [" %r: %r,\n" % it for it in md5_data.items()] - data = [" %r: %r,\n" % it for it in md5_data.items()] + data = [" %r: %r,\n" % it for it in list(md5_data.items())] + data = [" %r: %r,\n" % it for it in list(md5_data.items())] data.sort() data.sort() repl = "".join(data) repl = "".join(data) @@ -234,7 +234,7 @@ @@ -234,7 +234,7 @@ match = re.search("\nmd5_data = {\n([^}]+)}", src) match = re.search("\nmd5_data = {\n([^}]+)}", src) if not match: if not match: - print >>sys.stderr, "Internal error!" - print >>sys.stderr, "Internal error!" + print("Internal error!", file=sys.stderr) + print("Internal error!", file=sys.stderr) sys.exit(2) sys.exit(2) src = src[:match.start(1)] + repl + src[match.end(1):] src = src[:match.start(1)] + repl + src[match.end(1):] --- python3/google/apputils/app.py (original) --- python3/google/apputils/app.py (original) +++ python3/google/apputils/app.py (refactored) +++ python3/google/apputils/app.py (refactored) @@ -90,8 +90,8 @@ @@ -90,8 +90,8 @@ if arg: if arg: usage(shorthelp=1, writeto_stdout=1) usage(shorthelp=1, writeto_stdout=1) # Advertise --helpfull on stdout, since usage() was on stdout. # Advertise --helpfull on stdout, since usage() was on stdout. - print - print - print 'Try --helpfull to get a list of all flags.' - print 'Try --helpfull to get a list of all flags.' + print() + print() + print('Try --helpfull to get a list of all flags.') + print('Try --helpfull to get a list of all flags.') sys.exit(1) sys.exit(1) @@ -145,7 +145,7 @@ @@ -145,7 +145,7 @@ try: try: argv = FLAGS(args) argv = FLAGS(args) return argv return argv - except flags.FlagsError, error: - except flags.FlagsError, error: + except flags.FlagsError as error: + except flags.FlagsError as error: sys.stderr.write('FATAL Flags parsing error: %s\n' % error) sys.stderr.write('FATAL Flags parsing error: %s\n' % error) sys.stderr.write('Pass --helpshort or --helpfull to see help on flags.\n') sys.stderr.write('Pass --helpshort or --helpfull to see help on flags.\n') sys.exit(1) sys.exit(1) @@ -217,7 +217,7 @@ @@ -217,7 +217,7 @@ sys.exit(retval) sys.exit(retval) else: else: sys.exit(main(argv)) sys.exit(main(argv)) - except UsageError, error: - except UsageError, error: + except UsageError as error: + except UsageError as error: usage(shorthelp=1, detailed_error=error, exitcode=error.exitcode) usage(shorthelp=1, detailed_error=error, exitcode=error.exitcode) except: except: if FLAGS.pdb_post_mortem: if FLAGS.pdb_post_mortem: @@ -264,9 +264,9 @@ @@ -264,9 +264,9 @@ try: try: really_start() really_start() - except SystemExit, e: - except SystemExit, e: + except SystemExit as e: + except SystemExit as e: raise raise - except Exception, e: - except Exception, e: + except Exception as e: + except Exception as e: # Call any installed exception handlers which may, for example, # Call any installed exception handlers which may, for example, # log to a file or send email. # log to a file or send email. for handler in EXCEPTION_HANDLERS: for handler in EXCEPTION_HANDLERS: @@ -322,7 +322,7 @@ @@ -322,7 +322,7 @@ stdfile.write('\n') stdfile.write('\n') if detailed_error is not None: if detailed_error is not None: stdfile.write('\n%s\n' % detailed_error) stdfile.write('\n%s\n' % detailed_error) - except IOError, e: - except IOError, e: + except IOError as e: + except IOError as e: # We avoid printing a huge backtrace if we get EPIPE, because # We avoid printing a huge backtrace if we get EPIPE, because # "foo.par --help | less" is a frequent use case. # "foo.par --help | less" is a frequent use case. if e.errno != errno.EPIPE: if e.errno != errno.EPIPE: --- python3/google/apputils/appcommands.py (original) --- python3/google/apputils/appcommands.py (original) +++ python3/google/apputils/appcommands.py (refactored) +++ python3/google/apputils/appcommands.py (refactored) @@ -175,7 +175,7 @@ @@ -175,7 +175,7 @@ def GetFullCommandList(): def GetFullCommandList(): """Return list of registered commands, including aliases.""" """Return list of registered commands, including aliases.""" all_cmds = dict(GetCommandList()) all_cmds = dict(GetCommandList()) - for cmd_alias, cmd_name in GetCommandAliasList().iteritems(): - for cmd_alias, cmd_name in GetCommandAliasList().iteritems(): + for cmd_alias, cmd_name in GetCommandAliasList().items(): + for cmd_alias, cmd_name in GetCommandAliasList().items(): all_cmds[cmd_alias] = all_cmds.get(cmd_name) all_cmds[cmd_alias] = all_cmds.get(cmd_name) return all_cmds return all_cmds @@ -295,7 +295,7 @@ @@ -295,7 +295,7 @@ else: else: assert isinstance(ret, int) assert isinstance(ret, int) return ret return ret - except app.UsageError, error: - except app.UsageError, error: + except app.UsageError as error: + except app.UsageError as error: app.usage(shorthelp=1, detailed_error=error, exitcode=error.exitcode) app.usage(shorthelp=1, detailed_error=error, exitcode=error.exitcode) except: except: if FLAGS.pdb_post_mortem: if FLAGS.pdb_post_mortem: @@ -622,7 +622,7 @@ @@ -622,7 +622,7 @@ else: else: # Show list of commands # Show list of commands if show_cmd is None or show_cmd == 'help': if show_cmd is None or show_cmd == 'help': - cmd_names = GetCommandList().keys() - cmd_names = GetCommandList().keys() + cmd_names = list(GetCommandList().keys()) + cmd_names = list(GetCommandList().keys()) cmd_names.sort() cmd_names.sort() stdfile.write('Any of the following commands:\n') stdfile.write('Any of the following commands:\n') doc = ', '.join(cmd_names) doc = ', '.join(cmd_names) @@ -634,7 +634,7 @@ @@ -634,7 +634,7 @@ elif FLAGS.help or FLAGS.helpshort or shorthelp: elif FLAGS.help or FLAGS.helpshort or shorthelp: cmd_names = [] cmd_names = [] else: else: - cmd_names = GetCommandList().keys() # show all commands - cmd_names = GetCommandList().keys() # show all commands + cmd_names = list(GetCommandList().keys()) # show all commands + cmd_names = list(GetCommandList().keys()) # show all commands cmd_names.sort() cmd_names.sort() # Show the command help (none, one specific, or all) # Show the command help (none, one specific, or all) for name in cmd_names: for name in cmd_names: @@ -702,7 +702,7 @@ @@ -702,7 +702,7 @@ try: try: _cmd_argv = FLAGS(argv) _cmd_argv = FLAGS(argv) return _cmd_argv return _cmd_argv - except flags.FlagsError, error: - except flags.FlagsError, error: + except flags.FlagsError as error: + except flags.FlagsError as error: ShortHelpAndExit('FATAL Flags parsing error: %s' % error) ShortHelpAndExit('FATAL Flags parsing error: %s' % error) @@ -757,9 +757,9 @@ @@ -757,9 +757,9 @@ try: try: sys.modules['__main__'].main(GetCommandArgv()) sys.modules['__main__'].main(GetCommandArgv()) # If sys.exit was called, return with error code. # If sys.exit was called, return with error code. - except SystemExit, e: - except SystemExit, e: + except SystemExit as e: + except SystemExit as e: sys.exit(e.code) sys.exit(e.code) - except Exception, error: - except Exception, error: + except Exception as error: + except Exception as error: traceback.print_exc() # Print a backtrace to stderr. traceback.print_exc() # Print a backtrace to stderr. ShortHelpAndExit('\nFATAL error in main: %s' % error) ShortHelpAndExit('\nFATAL error in main: %s' % error) --- python3/google/apputils/basetest.py (original) --- python3/google/apputils/basetest.py (original) +++ python3/google/apputils/basetest.py (refactored) +++ python3/google/apputils/basetest.py (refactored) @@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@ import tempfile import tempfile import types import types import unittest import unittest -import urlparse -import urlparse +import urllib.parse +import urllib.parse try: try: import faulthandler # pylint: disable=g-import-not-at-top import faulthandler # pylint: disable=g-import-not-at-top @@ -348,8 +348,8 @@ @@ -348,8 +348,8 @@ # Fail on strings: empirically, passing strings to this test method # Fail on strings: empirically, passing strings to this test method # is almost always a bug. If comparing the character sets of two strings # is almost always a bug. If comparing the character sets of two strings # is desired, cast the inputs to sets or lists explicitly. # is desired, cast the inputs to sets or lists explicitly. - if (isinstance(expected_seq, basestring) or - if (isinstance(expected_seq, basestring) or - isinstance(actual_seq, basestring)): - isinstance(actual_seq, basestring)): + if (isinstance(expected_seq, str) or + if (isinstance(expected_seq, str) or + isinstance(actual_seq, str)): + isinstance(actual_seq, str)): self.fail('Passing a string to assertSameElements is usually a bug. ' self.fail('Passing a string to assertSameElements is usually a bug. ' 'Did you mean to use assertEqual?\n' 'Did you mean to use assertEqual?\n' 'Expected: %s\nActual: %s' % (expected_seq, actual_seq)) 'Expected: %s\nActual: %s' % (expected_seq, actual_seq)) @@ -380,9 +380,9 @@ @@ -380,9 +380,9 @@ # has a different error format. However, I find this slightly more readable. # has a different error format. However, I find this slightly more readable. def assertMultiLineEqual(self, first, second, msg=None): def assertMultiLineEqual(self, first, second, msg=None): """Assert that two multi-line strings are equal.""" """Assert that two multi-line strings are equal.""" - assert isinstance(first, types.StringTypes), ( - assert isinstance(first, types.StringTypes), ( + assert isinstance(first, (str,)), ( + assert isinstance(first, (str,)), ( 'First argument is not a string: %r' % (first,)) 'First argument is not a string: %r' % (first,)) - assert isinstance(second, types.StringTypes), ( - assert isinstance(second, types.StringTypes), ( + assert isinstance(second, (str,)), ( + assert isinstance(second, (str,)), ( 'Second argument is not a string: %r' % (second,)) 'Second argument is not a string: %r' % (second,)) if first == second: if first == second: @@ -401,8 +401,8 @@ @@ -401,8 +401,8 @@ """Asserts that value is between minv and maxv (inclusive).""" """Asserts that value is between minv and maxv (inclusive).""" if msg is None: if msg is None: msg = '"%r" unexpectedly not between "%r" and "%r"' % (value, minv, maxv) msg = '"%r" unexpectedly not between "%r" and "%r"' % (value, minv, maxv) - self.assert_(minv <= value, msg) - self.assert_(minv <= value, msg) - self.assert_(maxv >= value, msg) - self.assert_(maxv >= value, msg) + self.assertTrue(minv <= value, msg) + self.assertTrue(minv <= value, msg) + self.assertTrue(maxv >= value, msg) + self.assertTrue(maxv >= value, msg) def assertRegexMatch(self, actual_str, regexes, message=None): def assertRegexMatch(self, actual_str, regexes, message=None): # pylint: disable=g-doc-bad-indent # pylint: disable=g-doc-bad-indent @@ -438,7 +438,7 @@ @@ -438,7 +438,7 @@ message: The message to be printed if the test fails. message: The message to be printed if the test fails. """ """ # pylint: enable=g-doc-bad-indent # pylint: enable=g-doc-bad-indent - if isinstance(regexes, basestring): - if isinstance(regexes, basestring): + if isinstance(regexes, str): + if isinstance(regexes, str): self.fail('regexes is a string; use assertRegexpMatches instead.') self.fail('regexes is a string; use assertRegexpMatches instead.') if not regexes: if not regexes: self.fail('No regexes specified.') self.fail('No regexes specified.') @@ -448,15 +448,15 @@ @@ -448,15 +448,15 @@ if type(regex) is not regex_type: if type(regex) is not regex_type: self.fail('regexes list must all be the same type.') self.fail('regexes list must all be the same type.') - if regex_type is bytes and isinstance(actual_str, unicode): - if regex_type is bytes and isinstance(actual_str, unicode): + if regex_type is bytes and isinstance(actual_str, str): + if regex_type is bytes and isinstance(actual_str, str): regexes = [regex.decode('utf-8') for regex in regexes] regexes = [regex.decode('utf-8') for regex in regexes] - regex_type = unicode - regex_type = unicode - elif regex_type is unicode and isinstance(actual_str, bytes): - elif regex_type is unicode and isinstance(actual_str, bytes): + regex_type = str + regex_type = str + elif regex_type is str and isinstance(actual_str, bytes): + elif regex_type is str and isinstance(actual_str, bytes): regexes = [regex.encode('utf-8') for regex in regexes] regexes = [regex.encode('utf-8') for regex in regexes] regex_type = bytes regex_type = bytes - if regex_type is unicode: - if regex_type is unicode: - regex = u'(?:%s)' % u')|(?:'.join(regexes) - regex = u'(?:%s)' % u')|(?:'.join(regexes) + if regex_type is str: + if regex_type is str: + regex = '(?:%s)' % ')|(?:'.join(regexes) + regex = '(?:%s)' % ')|(?:'.join(regexes) elif regex_type is bytes: elif regex_type is bytes: regex = b'(?:' + (b')|(?:'.join(regexes)) + b')' regex = b'(?:' + (b')|(?:'.join(regexes)) + b')' else: else: @@ -481,7 +481,7 @@ @@ -481,7 +481,7 @@ # Accommodate code which listed their output regexes w/o the b'' prefix by # Accommodate code which listed their output regexes w/o the b'' prefix by # converting them to bytes for the user. # converting them to bytes for the user. - if isinstance(regexes[0], unicode): - if isinstance(regexes[0], unicode): + if isinstance(regexes[0], str): + if isinstance(regexes[0], str): regexes = [regex.encode('utf-8') for regex in regexes] regexes = [regex.encode('utf-8') for regex in regexes] command_string = GetCommandString(command) command_string = GetCommandString(command) @@ -519,7 +519,7 @@ @@ -519,7 +519,7 @@ # Accommodate code which listed their output regexes w/o the b'' prefix by # Accommodate code which listed their output regexes w/o the b'' prefix by # converting them to bytes for the user. # converting them to bytes for the user. - if isinstance(regexes[0], unicode): - if isinstance(regexes[0], unicode): + if isinstance(regexes[0], str): + if isinstance(regexes[0], str): regexes = [regex.encode('utf-8') for regex in regexes] regexes = [regex.encode('utf-8') for regex in regexes] command_string = GetCommandString(command) command_string = GetCommandString(command) @@ -578,7 +578,7 @@ @@ -578,7 +578,7 @@ """ """ # pylint: enable=g-doc-args # pylint: enable=g-doc-args def Check(err): def Check(err): - self.assert_(predicate(err), - self.assert_(predicate(err), + self.assertTrue(predicate(err), + self.assertTrue(predicate(err), '%r does not match predicate %r' % (err, predicate)) '%r does not match predicate %r' % (err, predicate)) context = self._AssertRaisesContext(expected_exception, self, Check) context = self._AssertRaisesContext(expected_exception, self, Check) @@ -617,7 +617,7 @@ @@ -617,7 +617,7 @@ # pylint: enable=g-doc-args # pylint: enable=g-doc-args def Check(err): def Check(err): actual_exception_message = str(err) actual_exception_message = str(err) - self.assert_(expected_exception_message == actual_exception_message, - self.assert_(expected_exception_message == actual_exception_message, + self.assertTrue(expected_exception_message == actual_exception_message, + self.assertTrue(expected_exception_message == actual_exception_message, 'Exception message does not match.\n' 'Exception message does not match.\n' 'Expected: %r\n' 'Expected: %r\n' 'Actual: %r' % (expected_exception_message, 'Actual: %r' % (expected_exception_message, @@ -653,7 +653,7 @@ @@ -653,7 +653,7 @@ """ """ # pylint: enable=g-doc-args # pylint: enable=g-doc-args # TODO(user): this is a good candidate for a global search-and-replace. # TODO(user): this is a good candidate for a global search-and-replace. - return self.assertRaisesRegexp(expected_exception, expected_regexp, - return self.assertRaisesRegexp(expected_exception, expected_regexp, + return self.assertRaisesRegex(expected_exception, expected_regexp, + return self.assertRaisesRegex(expected_exception, expected_regexp, callable_obj, *args, **kwargs) callable_obj, *args, **kwargs) def assertContainsInOrder(self, strings, target): def assertContainsInOrder(self, strings, target): @@ -823,8 +823,8 @@ @@ -823,8 +823,8 @@ if a == b: if a == b: return return - a_items = Sorted(list(a.iteritems())) - a_items = Sorted(list(a.iteritems())) - b_items = Sorted(list(b.iteritems())) - b_items = Sorted(list(b.iteritems())) + a_items = Sorted(list(a.items())) + a_items = Sorted(list(a.items())) + b_items = Sorted(list(b.items())) + b_items = Sorted(list(b.items())) unexpected = [] unexpected = [] missing = [] missing = [] @@ -837,7 +837,7 @@ @@ -837,7 +837,7 @@ # Sort the entries based on their repr, not based on their sort order, # Sort the entries based on their repr, not based on their sort order, # which will be non-deterministic across executions, for many types. # which will be non-deterministic across executions, for many types. entries = sorted((safe_repr(k), safe_repr(v)) entries = sorted((safe_repr(k), safe_repr(v)) - for k, v in dikt.iteritems()) - for k, v in dikt.iteritems()) + for k, v in dikt.items()) + for k, v in dikt.items()) return '{%s}' % (', '.join('%s: %s' % pair for pair in entries)) return '{%s}' % (', '.join('%s: %s' % pair for pair in entries)) message = ['%s != %s%s' % (Repr(a), Repr(b), ' (%s)' % msg if msg else '')] message = ['%s != %s%s' % (Repr(a), Repr(b), ' (%s)' % msg if msg else '')] @@ -875,8 +875,8 @@ @@ -875,8 +875,8 @@ def assertUrlEqual(self, a, b): def assertUrlEqual(self, a, b): """Asserts that urls are equal, ignoring ordering of query params.""" """Asserts that urls are equal, ignoring ordering of query params.""" - parsed_a = urlparse.urlparse(a) - parsed_a = urlparse.urlparse(a) - parsed_b = urlparse.urlparse(b) - parsed_b = urlparse.urlparse(b) + parsed_a = urllib.parse.urlparse(a) + parsed_a = urllib.parse.urlparse(a) + parsed_b = urllib.parse.urlparse(b) + parsed_b = urllib.parse.urlparse(b) self.assertEqual(parsed_a.scheme, parsed_b.scheme) self.assertEqual(parsed_a.scheme, parsed_b.scheme) self.assertEqual(parsed_a.netloc, parsed_b.netloc) self.assertEqual(parsed_a.netloc, parsed_b.netloc) self.assertEqual(parsed_a.path, parsed_b.path) self.assertEqual(parsed_a.path, parsed_b.path) @@ -884,8 +884,8 @@ @@ -884,8 +884,8 @@ self.assertEqual(sorted(parsed_a.params.split(';')), self.assertEqual(sorted(parsed_a.params.split(';')), sorted(parsed_b.params.split(';'))) sorted(parsed_b.params.split(';'))) self.assertDictEqual( self.assertDictEqual( - urlparse.parse_qs(parsed_a.query, keep_blank_values=True), - urlparse.parse_qs(parsed_a.query, keep_blank_values=True), - urlparse.parse_qs(parsed_b.query, keep_blank_values=True)) - urlparse.parse_qs(parsed_b.query, keep_blank_values=True)) + urllib.parse.parse_qs(parsed_a.query, keep_blank_values=True), + urllib.parse.parse_qs(parsed_a.query, keep_blank_values=True), + urllib.parse.parse_qs(parsed_b.query, keep_blank_values=True)) + urllib.parse.parse_qs(parsed_b.query, keep_blank_values=True)) def assertSameStructure(self, a, b, aname='a', bname='b', msg=None): def assertSameStructure(self, a, b, aname='a', bname='b', msg=None): """Asserts that two values contain the same structural content. """Asserts that two values contain the same structural content. @@ -1059,7 +1059,7 @@ @@ -1059,7 +1059,7 @@ # Open file to save stream to # Open file to save stream to cap_fd = os.open(self._filename, cap_fd = os.open(self._filename, os.O_CREAT | os.O_TRUNC | os.O_WRONLY, os.O_CREAT | os.O_TRUNC | os.O_WRONLY, - 0600) - 0600) + 0o600) + 0o600) # Send stream to this file # Send stream to this file self._stream.flush() self._stream.flush() @@ -1074,7 +1074,7 @@ @@ -1074,7 +1074,7 @@ # Append stream to file # Append stream to file cap_fd = os.open(self._filename, cap_fd = os.open(self._filename, os.O_CREAT | os.O_APPEND | os.O_WRONLY, os.O_CREAT | os.O_APPEND | os.O_WRONLY, - 0600) - 0600) + 0o600) + 0o600) # Send stream to this file # Send stream to this file self._stream.flush() self._stream.flush() @@ -1105,7 +1105,7 @@ @@ -1105,7 +1105,7 @@ stream: Should be sys.stdout or sys.stderr. stream: Should be sys.stdout or sys.stderr. filename: File where output should be stored. filename: File where output should be stored. """ """ - assert not _captured_streams.has_key(stream) - assert not _captured_streams.has_key(stream) + assert stream not in _captured_streams + assert stream not in _captured_streams _captured_streams[stream] = CapturedStream(stream, filename) _captured_streams[stream] = CapturedStream(stream, filename) @@ -1115,8 +1115,8 @@ @@ -1115,8 +1115,8 @@ Args: Args: stream: Should be sys.stdout or sys.stderr. stream: Should be sys.stdout or sys.stderr. """ """ - assert _captured_streams.has_key(stream) - assert _captured_streams.has_key(stream) - for cap_stream in _captured_streams.itervalues(): - for cap_stream in _captured_streams.itervalues(): + assert stream in _captured_streams + assert stream in _captured_streams + for cap_stream in _captured_streams.values(): + for cap_stream in _captured_streams.values(): cap_stream.StopCapture() cap_stream.StopCapture() @@ -1136,7 +1136,7 @@ @@ -1136,7 +1136,7 @@ # remove the current stream # remove the current stream del _captured_streams[stream] del _captured_streams[stream] # restore other stream capture # restore other stream capture - for cap_stream in _captured_streams.itervalues(): - for cap_stream in _captured_streams.itervalues(): + for cap_stream in _captured_streams.values(): + for cap_stream in _captured_streams.values(): cap_stream.RestartCapture() cap_stream.RestartCapture() @@ -1257,7 +1257,7 @@ @@ -1257,7 +1257,7 @@ os.close(fd) os.close(fd) -_INT_TYPES = (int, long) # Sadly there is no types.IntTypes defined for us. -_INT_TYPES = (int, long) # Sadly there is no types.IntTypes defined for us. +_INT_TYPES = (int, int) # Sadly there is no types.IntTypes defined for us. +_INT_TYPES = (int, int) # Sadly there is no types.IntTypes defined for us. def _WalkStructureForProblems(a, b, aname, bname, problem_list): def _WalkStructureForProblems(a, b, aname, bname, problem_list): @@ -1284,15 +1284,15 @@ @@ -1284,15 +1284,15 @@ problem_list.append('%s lacks [%r] but %s has it' % (aname, k, bname)) problem_list.append('%s lacks [%r] but %s has it' % (aname, k, bname)) # Strings are Sequences but we'll just do those with regular != # Strings are Sequences but we'll just do those with regular != - elif isinstance(a, collections.Sequence) and not isinstance(a, basestring): - elif isinstance(a, collections.Sequence) and not isinstance(a, basestring): + elif isinstance(a, collections.Sequence) and not isinstance(a, str): + elif isinstance(a, collections.Sequence) and not isinstance(a, str): minlen = min(len(a), len(b)) minlen = min(len(a), len(b)) - for i in xrange(minlen): - for i in xrange(minlen): + for i in range(minlen): + for i in range(minlen): _WalkStructureForProblems(a[i], b[i], _WalkStructureForProblems(a[i], b[i], '%s[%d]' % (aname, i), '%s[%d]' % (bname, i), '%s[%d]' % (aname, i), '%s[%d]' % (bname, i), problem_list) problem_list) - for i in xrange(minlen, len(a)): - for i in xrange(minlen, len(a)): + for i in range(minlen, len(a)): + for i in range(minlen, len(a)): problem_list.append('%s has [%i] but %s does not' % (aname, i, bname)) problem_list.append('%s has [%i] but %s does not' % (aname, i, bname)) - for i in xrange(minlen, len(b)): - for i in xrange(minlen, len(b)): + for i in range(minlen, len(b)): + for i in range(minlen, len(b)): problem_list.append('%s lacks [%i] but %s has it' % (aname, i, bname))RefactoringTool: No changes to python3/google/apputils/datelib.py problem_list.append('%s lacks [%i] but %s has it' % (aname, i, bname))RefactoringTool: No changes to python3/google/apputils/datelib.py RefactoringTool: No changes to python3/google/apputils/debug.py RefactoringTool: No changes to python3/google/apputils/debug.py RefactoringTool: Refactored python3/google/apputils/file_util.py RefactoringTool: Refactored python3/google/apputils/file_util.py RefactoringTool: Refactored python3/google/apputils/humanize.py RefactoringTool: Refactored python3/google/apputils/humanize.py RefactoringTool: No changes to python3/google/apputils/resources.py RefactoringTool: No changes to python3/google/apputils/resources.py RefactoringTool: Refactored python3/google/apputils/run_script_module.py RefactoringTool: Refactored python3/google/apputils/run_script_module.py RefactoringTool: Refactored python3/google/apputils/setup_command.py RefactoringTool: Refactored python3/google/apputils/setup_command.py RefactoringTool: No changes to python3/google/apputils/shellutil.py RefactoringTool: No changes to python3/google/apputils/shellutil.py RefactoringTool: Refactored python3/google/apputils/stopwatch.py RefactoringTool: Refactored python3/google/apputils/stopwatch.py RefactoringTool: No changes to python3/tests/app_test.py RefactoringTool: No changes to python3/tests/app_test.py RefactoringTool: No changes to python3/tests/app_test_helper.py RefactoringTool: No changes to python3/tests/app_test_helper.py RefactoringTool: Refactored python3/tests/appcommands_example.py RefactoringTool: Refactored python3/tests/appcommands_example.py else: else: @@ -1380,7 +1380,7 @@ @@ -1380,7 +1380,7 @@ Returns: Returns: A string suitable for use as a shell command. A string suitable for use as a shell command. """ """ - if isinstance(command, types.StringTypes): - if isinstance(command, types.StringTypes): + if isinstance(command, (str,)): + if isinstance(command, (str,)): return command return command else: else: return shellutil.ShellEscapeList(command) return shellutil.ShellEscapeList(command) @@ -1404,7 +1404,7 @@ @@ -1404,7 +1404,7 @@ if os.environ.get('PYTHON_RUNFILES') and not env.get('PYTHON_RUNFILES'): if os.environ.get('PYTHON_RUNFILES') and not env.get('PYTHON_RUNFILES'): env['PYTHON_RUNFILES'] = os.environ['PYTHON_RUNFILES'] env['PYTHON_RUNFILES'] = os.environ['PYTHON_RUNFILES'] - use_shell = isinstance(command, types.StringTypes) - use_shell = isinstance(command, types.StringTypes) + use_shell = isinstance(command, (str,)) + use_shell = isinstance(command, (str,)) process = subprocess.Popen( process = subprocess.Popen( command, command, close_fds=close_fds, close_fds=close_fds, @@ -1540,7 +1540,7 @@ @@ -1540,7 +1540,7 @@ # Save command-line flags so the side effects of FLAGS(sys.argv) can be # Save command-line flags so the side effects of FLAGS(sys.argv) can be # undone. # undone. saved_flags = dict((f.name, SavedFlag(f)) saved_flags = dict((f.name, SavedFlag(f)) - for f in FLAGS.FlagDict().itervalues()) - for f in FLAGS.FlagDict().itervalues()) + for f in FLAGS.FlagDict().values()) + for f in FLAGS.FlagDict().values()) # Here we'd like to change the default of alsologtostderr from False to # Here we'd like to change the default of alsologtostderr from False to # True, so the test programs's stderr will contain all the log messages. # True, so the test programs's stderr will contain all the log messages. @@ -1577,7 +1577,7 @@ @@ -1577,7 +1577,7 @@ # after the command-line has been parsed. So we have the for loop below # after the command-line has been parsed. So we have the for loop below # to change back flags to their old values. # to change back flags to their old values. argv = FLAGS(sys.argv) argv = FLAGS(sys.argv) - for saved_flag in saved_flags.itervalues(): - for saved_flag in saved_flags.itervalues(): + for saved_flag in saved_flags.values(): + for saved_flag in saved_flags.values(): saved_flag.RestoreFlag() saved_flag.RestoreFlag() --- python3/google/apputils/file_util.py (original) --- python3/google/apputils/file_util.py (original) +++ python3/google/apputils/file_util.py (refactored) +++ python3/google/apputils/file_util.py (refactored) @@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@ return fp.read() return fp.read() -def Write(filename, contents, overwrite_existing=True, mode=0666, gid=None): -def Write(filename, contents, overwrite_existing=True, mode=0666, gid=None): +def Write(filename, contents, overwrite_existing=True, mode=0o666, gid=None): +def Write(filename, contents, overwrite_existing=True, mode=0o666, gid=None): """Create a file 'filename' with 'contents', with the mode given in 'mode'. """Create a file 'filename' with 'contents', with the mode given in 'mode'. The 'mode' is modified by the umask, as in open(2). If The 'mode' is modified by the umask, as in open(2). If @@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@ os.chown(filename, -1, gid) os.chown(filename, -1, gid) -def AtomicWrite(filename, contents, mode=0666, gid=None): -def AtomicWrite(filename, contents, mode=0666, gid=None): +def AtomicWrite(filename, contents, mode=0o666, gid=None): +def AtomicWrite(filename, contents, mode=0o666, gid=None): """Create a file 'filename' with 'contents' atomically. """Create a file 'filename' with 'contents' atomically. As in Write, 'mode' is modified by the umask. This creates and moves As in Write, 'mode' is modified by the umask. This creates and moves @@ -96,10 +96,10 @@ @@ -96,10 +96,10 @@ if gid is not None: if gid is not None: os.chown(tmp_filename, -1, gid) os.chown(tmp_filename, -1, gid) os.rename(tmp_filename, filename) os.rename(tmp_filename, filename) - except OSError, exc: - except OSError, exc: + except OSError as exc: + except OSError as exc: try: try: os.remove(tmp_filename) os.remove(tmp_filename) - except OSError, e: - except OSError, e: + except OSError as e: + except OSError as e: exc = OSError('%s. Additional errors cleaning up: %s' % (exc, e)) exc = OSError('%s. Additional errors cleaning up: %s' % (exc, e)) raise exc raise exc @@ -157,7 +157,7 @@ @@ -157,7 +157,7 @@ finally: finally: try: try: shutil.rmtree(temp_dir_path) shutil.rmtree(temp_dir_path) - except OSError, e: - except OSError, e: + except OSError as e: + except OSError as e: if e.message == 'Cannot call rmtree on a symbolic link': if e.message == 'Cannot call rmtree on a symbolic link': # Interesting synthetic exception made up by shutil.rmtree. # Interesting synthetic exception made up by shutil.rmtree. # Means we received a symlink from mkdtemp. # Means we received a symlink from mkdtemp. @@ -192,7 +192,7 @@ @@ -192,7 +192,7 @@ # only chmod if we created # only chmod if we created if force_mode is not None: if force_mode is not None: os.chmod(path, force_mode) os.chmod(path, force_mode) - except OSError, exc: - except OSError, exc: + except OSError as exc: + except OSError as exc: if not (exc.errno == errno.EEXIST and os.path.isdir(path)): if not (exc.errno == errno.EEXIST and os.path.isdir(path)): raise raise @@ -208,7 +208,7 @@ @@ -208,7 +208,7 @@ """ """ try: try: shutil.rmtree(dir_name) shutil.rmtree(dir_name) - except OSError, err: - except OSError, err: + except OSError as err: + except OSError as err: if err.errno != errno.ENOENT: if err.errno != errno.ENOENT: raise raise @@ -217,12 +217,12 @@ @@ -217,12 +217,12 @@ while parent_directory: while parent_directory: try: try: os.rmdir(parent_directory) os.rmdir(parent_directory) - except OSError, err: - except OSError, err: + except OSError as err: + except OSError as err: if err.errno != errno.ENOENT: if err.errno != errno.ENOENT: raise raise parent_directory = os.path.dirname(parent_directory) parent_directory = os.path.dirname(parent_directory) - except OSError, err: - except OSError, err: + except OSError as err: + except OSError as err: if err.errno not in (errno.EACCES, errno.ENOTEMPTY, errno.EPERM): if err.errno not in (errno.EACCES, errno.ENOTEMPTY, errno.EPERM): raise raise --- python3/google/apputils/humanize.py (original) --- python3/google/apputils/humanize.py (original) +++ python3/google/apputils/humanize.py (refactored) +++ python3/google/apputils/humanize.py (refactored) @@ -261,7 +261,7 @@ @@ -261,7 +261,7 @@ # Prefixes and corresponding min_scale and max_scale for decimal formating. # Prefixes and corresponding min_scale and max_scale for decimal formating. -DECIMAL_PREFIXES = ('y', 'z', 'a', 'f', 'p', 'n', u'µ', 'm', -DECIMAL_PREFIXES = ('y', 'z', 'a', 'f', 'p', 'n', u'µ', 'm', +DECIMAL_PREFIXES = ('y', 'z', 'a', 'f', 'p', 'n', 'µ', 'm', +DECIMAL_PREFIXES = ('y', 'z', 'a', 'f', 'p', 'n', 'µ', 'm', '', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y') '', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y') DECIMAL_MIN_SCALE = -8 DECIMAL_MIN_SCALE = -8 DECIMAL_MAX_SCALE = 8 DECIMAL_MAX_SCALE = 8 @@ -342,9 +342,9 @@ @@ -342,9 +342,9 @@ # Contains the fractions where the full range [1/n ... (n - 1) / n] # Contains the fractions where the full range [1/n ... (n - 1) / n] # is defined in Unicode. # is defined in Unicode. FRACTIONS = { FRACTIONS = { - 3: (None, u'⅓', u'⅔', None), - 3: (None, u'⅓', u'⅔', None), - 5: (None, u'⅕', u'⅖', u'⅗', u'⅘', None), - 5: (None, u'⅕', u'⅖', u'⅗', u'⅘', None), - 8: (None, u'⅛', u'¼', u'⅜', u'½', u'⅝', u'¾', u'⅞', None), - 8: (None, u'⅛', u'¼', u'⅜', u'½', u'⅝', u'¾', u'⅞', None), + 3: (None, '⅓', '⅔', None), + 3: (None, '⅓', '⅔', None), + 5: (None, '⅕', '⅖', '⅗', '⅘', None), + 5: (None, '⅕', '⅖', '⅗', '⅘', None), + 8: (None, '⅛', '¼', '⅜', '½', '⅝', '¾', '⅞', None), + 8: (None, '⅛', '¼', '⅜', '½', '⅝', '¾', '⅞', None), } } FRACTION_ROUND_DOWN = 1.0 / (max(FRACTIONS.keys()) * 2.0) FRACTION_ROUND_DOWN = 1.0 / (max(FRACTIONS.keys()) * 2.0) @@ -369,25 +369,25 @@ @@ -369,25 +369,25 @@ """ """ # We do not want small negative numbers to display as -0. # We do not want small negative numbers to display as -0. if number < -FRACTION_ROUND_DOWN: if number < -FRACTION_ROUND_DOWN: - return u'-%s' % PrettyFraction(-number) - return u'-%s' % PrettyFraction(-number) + return '-%s' % PrettyFraction(-number) + return '-%s' % PrettyFraction(-number) number = abs(number) number = abs(number) rounded = int(number) rounded = int(number) fract = number - rounded fract = number - rounded if fract >= FRACTION_ROUND_UP: if fract >= FRACTION_ROUND_UP: return str(rounded + 1) return str(rounded + 1) errors_fractions = [] errors_fractions = [] - for denominator, fraction_elements in FRACTIONS.items(): - for denominator, fraction_elements in FRACTIONS.items(): + for denominator, fraction_elements in list(FRACTIONS.items()): + for denominator, fraction_elements in list(FRACTIONS.items()): numerator = int(round(denominator * fract)) numerator = int(round(denominator * fract)) error = abs(fract - (float(numerator) / float(denominator))) error = abs(fract - (float(numerator) / float(denominator))) errors_fractions.append((error, fraction_elements[numerator])) errors_fractions.append((error, fraction_elements[numerator])) unused_error, fraction_text = min(errors_fractions) unused_error, fraction_text = min(errors_fractions) if rounded and fraction_text: if rounded and fraction_text: - return u'%d%s%s' % (rounded, spacer, fraction_text) - return u'%d%s%s' % (rounded, spacer, fraction_text) + return '%d%s%s' % (rounded, spacer, fraction_text) + return '%d%s%s' % (rounded, spacer, fraction_text) if rounded: if rounded: return str(rounded) return str(rounded) if fraction_text: if fraction_text: return fraction_text return fraction_text - return u'0' - return u'0' + return '0' + return '0' def Duration(duration, separator=' '): def Duration(duration, separator=' '): --- python3/google/apputils/run_script_module.py (original) --- python3/google/apputils/run_script_module.py (original) +++ python3/google/apputils/run_script_module.py (refactored) +++ python3/google/apputils/run_script_module.py (refactored) @@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@ def PrintOurUsage(): def PrintOurUsage(): """Print usage for the stub script.""" """Print usage for the stub script.""" - print 'Stub script %s (auto-generated). Options:' % sys.argv[0] - print 'Stub script %s (auto-generated). Options:' % sys.argv[0] + print('Stub script %s (auto-generated). Options:' % sys.argv[0]) + print('Stub script %s (auto-generated). Options:' % sys.argv[0]) print ('--helpstub ' print ('--helpstub ' 'Show help for stub script.') 'Show help for stub script.') print ('--debug_binary ' print ('--debug_binary ' @@ -203,8 +203,8 @@ @@ -203,8 +203,8 @@ args = [sys.executable] + args args = [sys.executable] + args if show_command_and_exit: if show_command_and_exit: - print 'program: "%s"' % program - print 'program: "%s"' % program - print 'args:', args - print 'args:', args + print('program: "%s"' % program) + print('program: "%s"' % program) + print('args:', args) + print('args:', args) sys.exit(0) sys.exit(0) try: try: --- python3/google/apputils/setup_command.py (original) --- python3/google/apputils/setup_command.py (original) +++ python3/google/apputils/setup_command.py (refactored) +++ python3/google/apputils/setup_command.py (refactored) @@ -125,7 +125,7 @@ @@ -125,7 +125,7 @@ sys.argv = [module.__file__] + self.test_args sys.argv = [module.__file__] + self.test_args # Late import since this must be run with the project's sys.path. # Late import since this must be run with the project's sys.path. - import basetest - import basetest + from . import basetest + from . import basetest try: try: try: try: sys.stderr.write('Testing %s\n' % module_name) sys.stderr.write('Testing %s\n' % module_name) --- python3/google/apputils/stopwatch.py (original) --- python3/google/apputils/stopwatch.py (original) +++ python3/google/apputils/stopwatch.py (refactored) +++ python3/google/apputils/stopwatch.py (refactored) @@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@ all_this. all_this. """ """ -import StringIO -import StringIO +import io +import io import time import time @@ -149,7 +149,7 @@ @@ -149,7 +149,7 @@ if total == 0.0: if total == 0.0: return 0.0 return 0.0 - all_timers = sum(self.accum.itervalues()) - all_timers = sum(self.accum.itervalues()) + all_timers = sum(self.accum.values()) + all_timers = sum(self.accum.values()) return total - (all_timers - total) return total - (all_timers - total) def results(self, verbose=False): def results(self, verbose=False): @@ -165,7 +165,7 @@ @@ -165,7 +165,7 @@ """ """ now = time.time() now = time.time() - all_names = self.accum.keys() - all_names = self.accum.keys() + all_names = list(self.accum.keys()) + all_names = list(self.accum.keys()) names = [] names = [] if 'total' in all_names: if 'total' in all_names: @@ -192,7 +192,7 @@ @@ -192,7 +192,7 @@ Returns: Returns: A string describing the stopwatch. A string describing the stopwatch. """ """ - output = StringIO.StringIO() - output = StringIO.StringIO() + output = io.StringIO() + output = io.StringIO() results = self.results(verbose=verbose) results = self.results(verbose=verbose) maxlength = max([len(result[0]) for result in results]) maxlength = max([len(result[0]) for result in results]) for result in results: for result in results: --- python3/tests/appcommands_example.py (original) --- python3/tests/appcommands_example.py (original) +++ python3/tests/appcommands_example.py (refactored) +++ python3/tests/appcommands_example.py (refactored) @@ -52,13 +52,13 @@ @@ -52,13 +52,13 @@ Returns: Returns: Value of flag fail1 Value of flag fail1 """ """ - print 'Command1' - print 'Command1' + print('Command1') + print('Command1') if FLAGS.hint: if FLAGS.hint: - print "Hint1:'%s'" % FLAGS.hint - print "Hint1:'%s'" % FLAGS.hint - print "Foo1:'%s'" % FLAGS.foo - print "Foo1:'%s'" % FLAGS.foo - print "Bar1:'%s'" % FLAGS.bar - print "Bar1:'%s'" % FLAGS.bar + print("Hint1:'%s'" % FLAGS.hint) + print("Hint1:'%s'" % FLAGS.hint) + print("Foo1:'%s'" % FLAGS.foo) + print("Foo1:'%s'" % FLAGS.foo) + print("Bar1:'%s'" % FLAGS.bar) + print("Bar1:'%s'" % FLAGS.bar) if FLAGS.allhelp: if FLAGS.allhelp: - print "AllHelp:'%s'" % self._all_commands_help - print "AllHelp:'%s'" % self._all_commands_help + print("AllHelp:'%s'" % self._all_commands_help) + print("AllHelp:'%s'" % self._all_commands_help) return FLAGS.fail1 * 1RefactoringTool: Refactored python3/tests/basetest_test.py return FLAGS.fail1 * 1RefactoringTool: Refactored python3/tests/basetest_test.py @@ -82,22 +82,22 @@ @@ -82,22 +82,22 @@ Returns: Returns: Value of flag fail2 Value of flag fail2 """ """ - print 'Command2' - print 'Command2' + print('Command2') + print('Command2') if FLAGS.hint: if FLAGS.hint: - print "Hint2:'%s'" % FLAGS.hint - print "Hint2:'%s'" % FLAGS.hint - print "Foo2:'%s'" % FLAGS.foo - print "Foo2:'%s'" % FLAGS.foo - print "Bar2:'%s'" % FLAGS.bar - print "Bar2:'%s'" % FLAGS.bar + print("Hint2:'%s'" % FLAGS.hint) + print("Hint2:'%s'" % FLAGS.hint) + print("Foo2:'%s'" % FLAGS.foo) + print("Foo2:'%s'" % FLAGS.foo) + print("Bar2:'%s'" % FLAGS.bar) + print("Bar2:'%s'" % FLAGS.bar) return FLAGS.fail2 * 1 return FLAGS.fail2 * 1 def Test3(unused_argv): def Test3(unused_argv): """Help for test3.""" """Help for test3.""" - print 'Command3' - print 'Command3' + print('Command3') + print('Command3') def Test4(unused_argv): def Test4(unused_argv): """Help for test4.""" """Help for test4.""" - print 'Command4' - print 'Command4' + print('Command4') + print('Command4') def main(unused_argv): def main(unused_argv): --- python3/tests/basetest_test.py (original) --- python3/tests/basetest_test.py (original) +++ python3/tests/basetest_test.py (refactored) +++ python3/tests/basetest_test.py (refactored) @@ -180,8 +180,8 @@ @@ -180,8 +180,8 @@ def testFlags(self): def testFlags(self): if FLAGS.testid == 1: if FLAGS.testid == 1: self.assertEqual(FLAGS.test_random_seed, 301) self.assertEqual(FLAGS.test_random_seed, 301) - self.assert_(FLAGS.test_tmpdir.startswith('/')) - self.assert_(FLAGS.test_tmpdir.startswith('/')) - self.assert_(os.access(FLAGS.test_tmpdir, os.W_OK)) - self.assert_(os.access(FLAGS.test_tmpdir, os.W_OK)) + self.assertTrue(FLAGS.test_tmpdir.startswith('/')) + self.assertTrue(FLAGS.test_tmpdir.startswith('/')) + self.assertTrue(os.access(FLAGS.test_tmpdir, os.W_OK)) + self.assertTrue(os.access(FLAGS.test_tmpdir, os.W_OK)) elif FLAGS.testid == 2: elif FLAGS.testid == 2: self.assertEqual(FLAGS.test_random_seed, 321) self.assertEqual(FLAGS.test_random_seed, 321) self.assertEqual(FLAGS.test_srcdir, 'cba') self.assertEqual(FLAGS.test_srcdir, 'cba') @@ -310,14 +310,14 @@ @@ -310,14 +310,14 @@ # Ensure we use equality as the sole measure of elements, not type, since # Ensure we use equality as the sole measure of elements, not type, since # that is consistent with dict equality. # that is consistent with dict equality. self.assertDictEqual({1: 1.0, 2: 2}, {1: 1, 2: 3}) self.assertDictEqual({1: 1.0, 2: 2}, {1: 1, 2: 3}) - except AssertionError, e: - except AssertionError, e: + except AssertionError as e: + except AssertionError as e: self.assertMultiLineEqual('{1: 1.0, 2: 2} != {1: 1, 2: 3}\n' self.assertMultiLineEqual('{1: 1.0, 2: 2} != {1: 1, 2: 3}\n' 'repr() of differing entries:\n2: 2 != 3\n', 'repr() of differing entries:\n2: 2 != 3\n', str(e)) str(e)) try: try: self.assertDictEqual({}, {'x': 1}) self.assertDictEqual({}, {'x': 1}) - except AssertionError, e: - except AssertionError, e: + except AssertionError as e: + except AssertionError as e: self.assertMultiLineEqual("{} != {'x': 1}\n" self.assertMultiLineEqual("{} != {'x': 1}\n" "Unexpected, but present entries:\n'x': 1\n", "Unexpected, but present entries:\n'x': 1\n", str(e)) str(e)) @@ -326,7 +326,7 @@ @@ -326,7 +326,7 @@ try: try: self.assertDictEqual({}, {'x': 1}, 'a message') self.assertDictEqual({}, {'x': 1}, 'a message') - except AssertionError, e: - except AssertionError, e: + except AssertionError as e: + except AssertionError as e: self.assertIn('a message', str(e)) self.assertIn('a message', str(e)) else: else: self.fail('Expecting AssertionError') self.fail('Expecting AssertionError') @@ -335,7 +335,7 @@ @@ -335,7 +335,7 @@ seen = {'a': 2, 'c': 3, 'd': 4} seen = {'a': 2, 'c': 3, 'd': 4} try: try: self.assertDictEqual(expected, seen) self.assertDictEqual(expected, seen) - except AssertionError, e: - except AssertionError, e: + except AssertionError as e: + except AssertionError as e: self.assertMultiLineEqual("""\ self.assertMultiLineEqual("""\ {'a': 1, 'b': 2, 'c': 3} != {'a': 2, 'c': 3, 'd': 4} {'a': 1, 'b': 2, 'c': 3} != {'a': 2, 'c': 3, 'd': 4} Unexpected, but present entries: Unexpected, but present entries: @@ -368,19 +368,19 @@ @@ -368,19 +368,19 @@ self.assertDictEqual( self.assertDictEqual( {'a': Obj('A'), Obj('b'): Obj('B'), Obj('c'): Obj('C')}, {'a': Obj('A'), Obj('b'): Obj('B'), Obj('c'): Obj('C')}, {'a': Obj('A'), Obj('d'): Obj('D'), Obj('e'): Obj('E')}) {'a': Obj('A'), Obj('d'): Obj('D'), Obj('e'): Obj('E')}) - except AssertionError, e: - except AssertionError, e: + except AssertionError as e: + except AssertionError as e: # Do as best we can not to be misleading when objects have the same repr # Do as best we can not to be misleading when objects have the same repr # but aren't equal. # but aren't equal. err_str = str(e) err_str = str(e) self.assertStartsWith(err_str, self.assertStartsWith(err_str, "{'a': A, b: B, c: C} != {'a': A, d: D, e: E}\n") "{'a': A, b: B, c: C} != {'a': A, d: D, e: E}\n") - self.assertRegexpMatches(err_str, - self.assertRegexpMatches(err_str, + self.assertRegex(err_str, + self.assertRegex(err_str, r'(?ms).*^Unexpected, but present entries:\s+' r'(?ms).*^Unexpected, but present entries:\s+' r'^(d: D$\s+^e: E|e: E$\s+^d: D)$') r'^(d: D$\s+^e: E|e: E$\s+^d: D)$') - self.assertRegexpMatches(err_str, - self.assertRegexpMatches(err_str, + self.assertRegex(err_str, + self.assertRegex(err_str, r'(?ms).*^repr\(\) of differing entries:\s+' r'(?ms).*^repr\(\) of differing entries:\s+' r'^.a.: A != A$', err_str) r'^.a.: A != A$', err_str) - self.assertRegexpMatches(err_str, - self.assertRegexpMatches(err_str, + self.assertRegex(err_str, + self.assertRegex(err_str, r'(?ms).*^Missing entries:\s+' r'(?ms).*^Missing entries:\s+' r'^(b: B$\s+^c: C|c: C$\s+^b: B)$') r'^(b: B$\s+^c: C|c: C$\s+^b: B)$') else: else: @@ -403,7 +403,7 @@ @@ -403,7 +403,7 @@ # prefix or a basetest_test prefix, so strip that for comparison. # prefix or a basetest_test prefix, so strip that for comparison. error_msg = re.sub( error_msg = re.sub( r'( at 0x[^>]+)|__main__\.|basetest_test\.', '', str(e)) r'( at 0x[^>]+)|__main__\.|basetest_test\.', '', str(e)) - self.assertRegexpMatches(error_msg, """(?m)\ - self.assertRegexpMatches(error_msg, """(?m)\ + self.assertRegex(error_msg, """(?m)\ + self.assertRegex(error_msg, """(?m)\ {<.*RaisesOnRepr object.*>: <.*RaisesOnRepr object.*>} != \ {<.*RaisesOnRepr object.*>: <.*RaisesOnRepr object.*>} != \ {<.*RaisesOnRepr object.*>: <.*RaisesOnRepr object.*>} {<.*RaisesOnRepr object.*>: <.*RaisesOnRepr object.*>} Unexpected, but present entries: Unexpected, but present entries: @@ -547,14 +547,14 @@ @@ -547,14 +547,14 @@ self.assertNotAlmostEqual(1.0000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) def testAssertAlmostEqualsWithDelta(self): def testAssertAlmostEqualsWithDelta(self): - self.assertAlmostEquals(3.14, 3, delta=0.2) - self.assertAlmostEquals(3.14, 3, delta=0.2) - self.assertAlmostEquals(2.81, 3.14, delta=1) - self.assertAlmostEquals(2.81, 3.14, delta=1) - self.assertAlmostEquals(-1, 1, delta=3) - self.assertAlmostEquals(-1, 1, delta=3) - self.assertRaises(AssertionError, self.assertAlmostEquals, - self.assertRaises(AssertionError, self.assertAlmostEquals, + self.assertAlmostEqual(3.14, 3, delta=0.2) + self.assertAlmostEqual(3.14, 3, delta=0.2) + self.assertAlmostEqual(2.81, 3.14, delta=1) + self.assertAlmostEqual(2.81, 3.14, delta=1) + self.assertAlmostEqual(-1, 1, delta=3) + self.assertAlmostEqual(-1, 1, delta=3) + self.assertRaises(AssertionError, self.assertAlmostEqual, + self.assertRaises(AssertionError, self.assertAlmostEqual, 3.14, 2.81, delta=0.1) 3.14, 2.81, delta=0.1) - self.assertRaises(AssertionError, self.assertAlmostEquals, - self.assertRaises(AssertionError, self.assertAlmostEquals, + self.assertRaises(AssertionError, self.assertAlmostEqual, + self.assertRaises(AssertionError, self.assertAlmostEqual, 1, 2, delta=0.5) 1, 2, delta=0.5) - self.assertNotAlmostEquals(3.14, 2.81, delta=0.1) - self.assertNotAlmostEquals(3.14, 2.81, delta=0.1) + self.assertNotAlmostEqual(3.14, 2.81, delta=0.1) + self.assertNotAlmostEqual(3.14, 2.81, delta=0.1) def testGetCommandString_listOfStringArgument(self): def testGetCommandString_listOfStringArgument(self): expected = "'command' 'arg-0'" expected = "'command' 'arg-0'" @@ -566,7 +566,7 @@ @@ -566,7 +566,7 @@ def testGetCommandString_listOfUnicodeStringArgument(self): def testGetCommandString_listOfUnicodeStringArgument(self): expected = "'command' 'arg-0'" expected = "'command' 'arg-0'" - observed = basetest.GetCommandString([u'command', u'arg-0']) - observed = basetest.GetCommandString([u'command', u'arg-0']) + observed = basetest.GetCommandString(['command', 'arg-0']) + observed = basetest.GetCommandString(['command', 'arg-0']) self.assertEqual(expected, observed) self.assertEqual(expected, observed) @@ -580,7 +580,7 @@ @@ -580,7 +580,7 @@ def testGetCommandString_unicodeStringArgument(self): def testGetCommandString_unicodeStringArgument(self): expected = 'command arg-0' expected = 'command arg-0' - observed = basetest.GetCommandString(u'command arg-0') - observed = basetest.GetCommandString(u'command arg-0') + observed = basetest.GetCommandString('command arg-0') + observed = basetest.GetCommandString('command arg-0') self.assertEqual(expected, observed) self.assertEqual(expected, observed) @@ -637,11 +637,11 @@ @@ -637,11 +637,11 @@ def testAssertRegexMatch_unicodeVsBytes(self): def testAssertRegexMatch_unicodeVsBytes(self): """Ensure proper utf-8 encoding or decoding happens automatically.""" """Ensure proper utf-8 encoding or decoding happens automatically.""" - self.assertRegexMatch(u'str', [b'str']) - self.assertRegexMatch(u'str', [b'str']) - self.assertRegexMatch(b'str', [u'str']) - self.assertRegexMatch(b'str', [u'str']) + self.assertRegexMatch('str', [b'str']) + self.assertRegexMatch('str', [b'str']) + self.assertRegexMatch(b'str', ['str']) + self.assertRegexMatch(b'str', ['str']) def testAssertRegexMatch_unicode(self): def testAssertRegexMatch_unicode(self): - self.assertRegexMatch(u'foo str', [u'str']) - self.assertRegexMatch(u'foo str', [u'str']) + self.assertRegexMatch('foo str', ['str']) + self.assertRegexMatch('foo str', ['str']) def testAssertRegexMatch_bytes(self): def testAssertRegexMatch_bytes(self): self.assertRegexMatch(b'foo str', [b'str']) self.assertRegexMatch(b'foo str', [b'str']) @@ -649,7 +649,7 @@ @@ -649,7 +649,7 @@ def testAssertRegexMatch_allTheSameType(self): def testAssertRegexMatch_allTheSameType(self): self.assertRaisesWithRegexpMatch( self.assertRaisesWithRegexpMatch( AssertionError, 'regexes .* same type', AssertionError, 'regexes .* same type', - self.assertRegexMatch, 'foo str', [b'str', u'foo']) - self.assertRegexMatch, 'foo str', [b'str', u'foo']) + self.assertRegexMatch, 'foo str', [b'str', 'foo']) + self.assertRegexMatch, 'foo str', [b'str', 'foo']) def testAssertCommandFailsStderr(self): def testAssertCommandFailsStderr(self): # TODO(user): Gross! These should use sys.executable instead of # TODO(user): Gross! These should use sys.executable instead of @@ -662,13 +662,13 @@ @@ -662,13 +662,13 @@ self.assertCommandFails(['false'], ['']) self.assertCommandFails(['false'], ['']) def testAssertCommandFailsWithListOfUnicodeString(self): def testAssertCommandFailsWithListOfUnicodeString(self): - self.assertCommandFails([u'false'], ['']) - self.assertCommandFails([u'false'], ['']) + self.assertCommandFails(['false'], ['']) + self.assertCommandFails(['false'], ['']) def testAssertCommandFailsWithUnicodeString(self): def testAssertCommandFailsWithUnicodeString(self): - self.assertCommandFails(u'false', [u'']) - self.assertCommandFails(u'false', [u'']) + self.assertCommandFails('false', ['']) + self.assertCommandFails('false', ['']) def testAssertCommandFailsWithUnicodeStringBytesRegex(self): def testAssertCommandFailsWithUnicodeStringBytesRegex(self): - self.assertCommandFails(u'false', [b'']) - self.assertCommandFails(u'false', [b'']) + self.assertCommandFails('false', [b'']) + self.assertCommandFails('false', [b'']) def testAssertCommandSucceedsStderr(self): def testAssertCommandSucceedsStderr(self): expected_re = re.compile(r'(.|\n)*FAIL at -e line 1\.', re.MULTILINE) expected_re = re.compile(r'(.|\n)*FAIL at -e line 1\.', re.MULTILINE) @@ -680,7 +680,7 @@ @@ -680,7 +680,7 @@ ['/usr/bin/perl', '-e', 'die "FAIL";']) ['/usr/bin/perl', '-e', 'die "FAIL";']) def testAssertCommandSucceedsWithMatchingUnicodeRegexes(self): def testAssertCommandSucceedsWithMatchingUnicodeRegexes(self): - self.assertCommandSucceeds(['echo', 'SUCCESS'], regexes=[u'SUCCESS']) - self.assertCommandSucceeds(['echo', 'SUCCESS'], regexes=[u'SUCCESS']) + self.assertCommandSucceeds(['echo', 'SUCCESS'], regexes=['SUCCESS']) + self.assertCommandSucceeds(['echo', 'SUCCESS'], regexes=['SUCCESS']) def testAssertCommandSucceedsWithMatchingBytesRegexes(self): def testAssertCommandSucceedsWithMatchingBytesRegexes(self): self.assertCommandSucceeds(['echo', 'SUCCESS'], regexes=[b'SUCCESS']) self.assertCommandSucceeds(['echo', 'SUCCESS'], regexes=[b'SUCCESS']) @@ -699,10 +699,10 @@ @@ -699,10 +699,10 @@ self.assertCommandSucceeds(['true']) self.assertCommandSucceeds(['true']) def testAssertCommandSucceedsWithListOfUnicodeString(self): def testAssertCommandSucceedsWithListOfUnicodeString(self): - self.assertCommandSucceeds([u'true']) - self.assertCommandSucceeds([u'true']) + self.assertCommandSucceeds(['true']) + self.assertCommandSucceeds(['true']) def testAssertCommandSucceedsWithUnicodeString(self): def testAssertCommandSucceedsWithUnicodeString(self): - self.assertCommandSucceeds(u'true') - self.assertCommandSucceeds(u'true') + self.assertCommandSucceeds('true') + self.assertCommandSucceeds('true') def testInequality(self): def testInequality(self): # Try ints # Try ints @@ -748,44 +748,44 @@ @@ -748,44 +748,44 @@ self.assertRaises(AssertionError, self.assertLessEqual, 'bug', 'ant') self.assertRaises(AssertionError, self.assertLessEqual, 'bug', 'ant') # Try Unicode # Try Unicode - self.assertGreater(u'bug', u'ant') - self.assertGreater(u'bug', u'ant') - self.assertGreaterEqual(u'bug', u'ant') - self.assertGreaterEqual(u'bug', u'ant') - self.assertGreaterEqual(u'ant', u'ant') - self.assertGreaterEqual(u'ant', u'ant') - self.assertLess(u'ant', u'bug') - self.assertLess(u'ant', u'bug') - self.assertLessEqual(u'ant', u'bug') - self.assertLessEqual(u'ant', u'bug') - self.assertLessEqual(u'ant', u'ant') - self.assertLessEqual(u'ant', u'ant') - self.assertRaises(AssertionError, self.assertGreater, u'ant', u'bug') - self.assertRaises(AssertionError, self.assertGreater, u'ant', u'bug') - self.assertRaises(AssertionError, self.assertGreater, u'ant', u'ant') - self.assertRaises(AssertionError, self.assertGreater, u'ant', u'ant') - self.assertRaises(AssertionError, self.assertGreaterEqual, u'ant', u'bug') - self.assertRaises(AssertionError, self.assertGreaterEqual, u'ant', u'bug') - self.assertRaises(AssertionError, self.assertLess, u'bug', u'ant') - self.assertRaises(AssertionError, self.assertLess, u'bug', u'ant') - self.assertRaises(AssertionError, self.assertLess, u'ant', u'ant') - self.assertRaises(AssertionError, self.assertLess, u'ant', u'ant') - self.assertRaises(AssertionError, self.assertLessEqual, u'bug', u'ant') - self.assertRaises(AssertionError, self.assertLessEqual, u'bug', u'ant') + self.assertGreater('bug', 'ant') + self.assertGreater('bug', 'ant') + self.assertGreaterEqual('bug', 'ant') + self.assertGreaterEqual('bug', 'ant') + self.assertGreaterEqual('ant', 'ant') + self.assertGreaterEqual('ant', 'ant') + self.assertLess('ant', 'bug') + self.assertLess('ant', 'bug') + self.assertLessEqual('ant', 'bug') + self.assertLessEqual('ant', 'bug') + self.assertLessEqual('ant', 'ant') + self.assertLessEqual('ant', 'ant') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertGreaterEqual, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreaterEqual, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertLess, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertLessEqual, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLessEqual, 'bug', 'ant') # Try Mixed String/Unicode # Try Mixed String/Unicode - self.assertGreater('bug', u'ant') - self.assertGreater('bug', u'ant') - self.assertGreater(u'bug', 'ant') - self.assertGreater(u'bug', 'ant') - self.assertGreaterEqual('bug', u'ant') - self.assertGreaterEqual('bug', u'ant') - self.assertGreaterEqual(u'bug', 'ant') - self.assertGreaterEqual(u'bug', 'ant') - self.assertGreaterEqual('ant', u'ant') - self.assertGreaterEqual('ant', u'ant') - self.assertGreaterEqual(u'ant', 'ant') - self.assertGreaterEqual(u'ant', 'ant') - self.assertLess('ant', u'bug') - self.assertLess('ant', u'bug') - self.assertLess(u'ant', 'bug') - self.assertLess(u'ant', 'bug') - self.assertLessEqual('ant', u'bug') - self.assertLessEqual('ant', u'bug') - self.assertLessEqual(u'ant', 'bug') - self.assertLessEqual(u'ant', 'bug') - self.assertLessEqual('ant', u'ant') - self.assertLessEqual('ant', u'ant') - self.assertLessEqual(u'ant', 'ant') - self.assertLessEqual(u'ant', 'ant') - self.assertRaises(AssertionError, self.assertGreater, 'ant', u'bug') - self.assertRaises(AssertionError, self.assertGreater, 'ant', u'bug') - self.assertRaises(AssertionError, self.assertGreater, u'ant', 'bug') - self.assertRaises(AssertionError, self.assertGreater, u'ant', 'bug') - self.assertRaises(AssertionError, self.assertGreater, 'ant', u'ant') - self.assertRaises(AssertionError, self.assertGreater, 'ant', u'ant') - self.assertRaises(AssertionError, self.assertGreater, u'ant', 'ant') - self.assertRaises(AssertionError, self.assertGreater, u'ant', 'ant') - self.assertRaises(AssertionError, self.assertGreaterEqual, 'ant', u'bug') - self.assertRaises(AssertionError, self.assertGreaterEqual, 'ant', u'bug') - self.assertRaises(AssertionError, self.assertGreaterEqual, u'ant', 'bug') - self.assertRaises(AssertionError, self.assertGreaterEqual, u'ant', 'bug') - self.assertRaises(AssertionError, self.assertLess, 'bug', u'ant') - self.assertRaises(AssertionError, self.assertLess, 'bug', u'ant') - self.assertRaises(AssertionError, self.assertLess, u'bug', 'ant') - self.assertRaises(AssertionError, self.assertLess, u'bug', 'ant') - self.assertRaises(AssertionError, self.assertLess, 'ant', u'ant') - self.assertRaises(AssertionError, self.assertLess, 'ant', u'ant') - self.assertRaises(AssertionError, self.assertLess, u'ant', 'ant') - self.assertRaises(AssertionError, self.assertLess, u'ant', 'ant') - self.assertRaises(AssertionError, self.assertLessEqual, 'bug', u'ant') - self.assertRaises(AssertionError, self.assertLessEqual, 'bug', u'ant') - self.assertRaises(AssertionError, self.assertLessEqual, u'bug', 'ant') - self.assertRaises(AssertionError, self.assertLessEqual, u'bug', 'ant') + self.assertGreater('bug', 'ant') + self.assertGreater('bug', 'ant') + self.assertGreater('bug', 'ant') + self.assertGreater('bug', 'ant') + self.assertGreaterEqual('bug', 'ant') + self.assertGreaterEqual('bug', 'ant') + self.assertGreaterEqual('bug', 'ant') + self.assertGreaterEqual('bug', 'ant') + self.assertGreaterEqual('ant', 'ant') + self.assertGreaterEqual('ant', 'ant') + self.assertGreaterEqual('ant', 'ant') + self.assertGreaterEqual('ant', 'ant') + self.assertLess('ant', 'bug') + self.assertLess('ant', 'bug') + self.assertLess('ant', 'bug') + self.assertLess('ant', 'bug') + self.assertLessEqual('ant', 'bug') + self.assertLessEqual('ant', 'bug') + self.assertLessEqual('ant', 'bug') + self.assertLessEqual('ant', 'bug') + self.assertLessEqual('ant', 'ant') + self.assertLessEqual('ant', 'ant') + self.assertLessEqual('ant', 'ant') + self.assertLessEqual('ant', 'ant') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertGreater, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertGreaterEqual, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreaterEqual, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreaterEqual, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertGreaterEqual, 'ant', 'bug') + self.assertRaises(AssertionError, self.assertLess, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertLess, 'ant', 'ant') + self.assertRaises(AssertionError, self.assertLessEqual, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLessEqual, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLessEqual, 'bug', 'ant') + self.assertRaises(AssertionError, self.assertLessEqual, 'bug', 'ant') def testAssertMultiLineEqual(self): def testAssertMultiLineEqual(self): sample_text = """\ sample_text = """\ @@ -811,8 +811,8 @@ @@ -811,8 +811,8 @@ + own implementation that does not subclass from TestCase, of course. + own implementation that does not subclass from TestCase, of course. """ """ - for type1 in (str, unicode): - for type1 in (str, unicode): - for type2 in (str, unicode): - for type2 in (str, unicode): + for type1 in (str, str): + for type1 in (str, str): + for type2 in (str, str): + for type2 in (str, str): self.assertRaisesWithLiteralMatch(AssertionError, sample_text_error, self.assertRaisesWithLiteralMatch(AssertionError, sample_text_error, self.assertMultiLineEqual, self.assertMultiLineEqual, type1(sample_text), type1(sample_text), @@ -886,12 +886,12 @@ @@ -886,12 +886,12 @@ self.assertRaises(AssertionError, self.assertBetween, -1e10000, -1e10, 0) self.assertRaises(AssertionError, self.assertBetween, -1e10000, -1e10, 0) def testAssertRaisesWithPredicateMatch_noRaiseFails(self): def testAssertRaisesWithPredicateMatch_noRaiseFails(self): - with self.assertRaisesRegexp(AssertionError, '^Exception not raised$'): - with self.assertRaisesRegexp(AssertionError, '^Exception not raised$'): + with self.assertRaisesRegex(AssertionError, '^Exception not raised$'): + with self.assertRaisesRegex(AssertionError, '^Exception not raised$'): self.assertRaisesWithPredicateMatch(Exception, self.assertRaisesWithPredicateMatch(Exception, lambda e: True, lambda e: True, lambda: 1) # don't raise lambda: 1) # don't raise - with self.assertRaisesRegexp(AssertionError, '^Exception not raised$'): - with self.assertRaisesRegexp(AssertionError, '^Exception not raised$'): + with self.assertRaisesRegex(AssertionError, '^Exception not raised$'): + with self.assertRaisesRegex(AssertionError, '^Exception not raised$'): with self.assertRaisesWithPredicateMatch(Exception, lambda e: True): with self.assertRaisesWithPredicateMatch(Exception, lambda e: True): pass # don't raise pass # don't raise @@ -911,12 +911,12 @@ @@ -911,12 +911,12 @@ def testAssertRaisesWithPredicateMatch_predicateFails(self): def testAssertRaisesWithPredicateMatch_predicateFails(self): def _RaiseValueError(): def _RaiseValueError(): raise ValueError raise ValueError - with self.assertRaisesRegexp(AssertionError, ' does not match predicate '): - with self.assertRaisesRegexp(AssertionError, ' does not match predicate '): + with self.assertRaisesRegex(AssertionError, ' does not match predicate '): + with self.assertRaisesRegex(AssertionError, ' does not match predicate '): self.assertRaisesWithPredicateMatch(ValueError, self.assertRaisesWithPredicateMatch(ValueError, lambda e: False, lambda e: False, _RaiseValueError) _RaiseValueError) - with self.assertRaisesRegexp(AssertionError, ' does not match predicate '): - with self.assertRaisesRegexp(AssertionError, ' does not match predicate '): + with self.assertRaisesRegex(AssertionError, ' does not match predicate '): + with self.assertRaisesRegex(AssertionError, ' does not match predicate '): with self.assertRaisesWithPredicateMatch(ValueError, lambda e: False): with self.assertRaisesWithPredicateMatch(ValueError, lambda e: False): raise ValueError raise ValueError @@ -940,7 +940,7 @@ @@ -940,7 +940,7 @@ self.assertRaisesWithRegexpMatch(ExceptionMock, re.compile('expect$'), Stub) self.assertRaisesWithRegexpMatch(ExceptionMock, re.compile('expect$'), Stub) self.assertRaisesWithRegexpMatch(ExceptionMock, 'expect$', Stub) self.assertRaisesWithRegexpMatch(ExceptionMock, 'expect$', Stub) - self.assertRaisesWithRegexpMatch(ExceptionMock, u'expect$', Stub) - self.assertRaisesWithRegexpMatch(ExceptionMock, u'expect$', Stub) + self.assertRaisesWithRegexpMatch(ExceptionMock, 'expect$', Stub) + self.assertRaisesWithRegexpMatch(ExceptionMock, 'expect$', Stub) def testAssertNotRaisesWithRegexpMatch(self): def testAssertNotRaisesWithRegexpMatch(self): self.assertRaisesWithRegexpMatch( self.assertRaisesWithRegexpMatch( @@ -952,7 +952,7 @@ @@ -952,7 +952,7 @@ self.assertRaisesWithRegexpMatch, Exception, 'x', lambda: None) self.assertRaisesWithRegexpMatch, Exception, 'x', lambda: None) self.assertRaisesWithRegexpMatch( self.assertRaisesWithRegexpMatch( AssertionError, '^Exception not raised', AssertionError, '^Exception not raised', - self.assertRaisesWithRegexpMatch, Exception, u'x', lambda: None) - self.assertRaisesWithRegexpMatch, Exception, u'x', lambda: None) + self.assertRaisesWithRegexpMatch, Exception, 'x', lambda: None) + self.assertRaisesWithRegexpMatch, Exception, 'x', lambda: None) def testAssertRaisesWithRegexpMismatch(self): def testAssertRaisesWithRegexpMismatch(self): def Stub(): def Stub(): @@ -1105,14 +1105,14 @@ @@ -1105,14 +1105,14 @@ self.assertRaises(AssertionError, self.assertTotallyOrdered, [1, 2]) self.assertRaises(AssertionError, self.assertTotallyOrdered, [1, 2]) def testShortDescriptionWithoutDocstring(self): def testShortDescriptionWithoutDocstring(self): - self.assertEquals( - self.assertEquals( + self.assertEqual( + self.assertEqual( self.shortDescription(), self.shortDescription(), ('testShortDescriptionWithoutDocstring ' ('testShortDescriptionWithoutDocstring ' '(%s.GoogleTestBaseUnitTest)' % __name__)) '(%s.GoogleTestBaseUnitTest)' % __name__)) def testShortDescriptionWithOneLineDocstring(self): def testShortDescriptionWithOneLineDocstring(self): """Tests shortDescription() for a method with a docstring.""" """Tests shortDescription() for a method with a docstring.""" - self.assertEquals( - self.assertEquals( + self.assertEqual( + self.assertEqual( self.shortDescription(), self.shortDescription(), ('testShortDescriptionWithOneLineDocstring ' ('testShortDescriptionWithOneLineDocstring ' '(%s.GoogleTestBaseUnitTest)\n' '(%s.GoogleTestBaseUnitTest)\n' @@ -1125,7 +1125,7 @@ @@ -1125,7 +1125,7 @@ returned used in the short description, no matter how long the returned used in the short description, no matter how long the whole thing is. whole thing is. """ """ - self.assertEquals( - self.assertEquals( + self.assertEqual( + self.assertEqual( self.shortDescription(), self.shortDescription(), ('testShortDescriptionWithMultiLineDocstring ' ('testShortDescriptionWithMultiLineDocstring ' '(%s.GoogleTestBaseUnitTest)\n' '(%s.GoogleTestBaseUnitTest)\n' @@ -1135,7 +1135,7 @@ @@ -1135,7 +1135,7 @@ def testRecordedProperties(self): def testRecordedProperties(self): """Tests that a test can record a property and then retrieve it.""" """Tests that a test can record a property and then retrieve it.""" self.recordProperty('test_property', 'test_value') self.recordProperty('test_property', 'test_value') - self.assertEquals(self.getRecordedProperties(), - self.assertEquals(self.getRecordedProperties(), + self.assertEqual(self.getRecordedProperties(), + self.assertEqual(self.getRecordedProperties(), {'test_property': 'test_value'}) {'test_property': 'test_value'}) def testAssertUrlEqualSame(self):RefactoringTool: Refactored python3/tests/datelib_unittest.py def testAssertUrlEqualSame(self):RefactoringTool: Refactored python3/tests/datelib_unittest.py RefactoringTool: Refactored python3/tests/file_util_test.py RefactoringTool: Refactored python3/tests/file_util_test.py @@ -1184,7 +1184,7 @@ @@ -1184,7 +1184,7 @@ self.assertSameStructure({}, {}) self.assertSameStructure({}, {}) self.assertSameStructure({'one': 1}, {'one': 1}) self.assertSameStructure({'one': 1}, {'one': 1}) # int and long should always be treated as the same type. # int and long should always be treated as the same type. - self.assertSameStructure({3L: 3}, {3: 3L}) - self.assertSameStructure({3L: 3}, {3: 3L}) + self.assertSameStructure({3: 3}, {3: 3}) + self.assertSameStructure({3: 3}, {3: 3}) def testSameStructure_different(self): def testSameStructure_different(self): # Different type # Different type @@ -1404,22 +1404,22 @@ @@ -1404,22 +1404,22 @@ # Compare two distinct objects # Compare two distinct objects self.assertFalse(i1 is i2) self.assertFalse(i1 is i2) self.assertRaises(AssertionError, self.assertEqual, i1, i2) self.assertRaises(AssertionError, self.assertEqual, i1, i2) - self.assertRaises(AssertionError, self.assertEquals, i1, i2) - self.assertRaises(AssertionError, self.assertEquals, i1, i2) - self.assertRaises(AssertionError, self.failUnlessEqual, i1, i2) - self.assertRaises(AssertionError, self.failUnlessEqual, i1, i2) + self.assertRaises(AssertionError, self.assertEqual, i1, i2) + self.assertRaises(AssertionError, self.assertEqual, i1, i2) + self.assertRaises(AssertionError, self.assertEqual, i1, i2) + self.assertRaises(AssertionError, self.assertEqual, i1, i2) self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) - self.assertRaises(AssertionError, self.assertNotEquals, i1, i2) - self.assertRaises(AssertionError, self.assertNotEquals, i1, i2) - self.assertRaises(AssertionError, self.failIfEqual, i1, i2) - self.assertRaises(AssertionError, self.failIfEqual, i1, i2) + self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) + self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) + self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) + self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) # A NeverEqual object should not compare equal to itself either. # A NeverEqual object should not compare equal to itself either. i2 = i1 i2 = i1 self.assertTrue(i1 is i2) self.assertTrue(i1 is i2) self.assertFalse(i1 == i2) self.assertFalse(i1 == i2) self.assertFalse(i1 != i2) self.assertFalse(i1 != i2) self.assertRaises(AssertionError, self.assertEqual, i1, i2) self.assertRaises(AssertionError, self.assertEqual, i1, i2) - self.assertRaises(AssertionError, self.assertEquals, i1, i2) - self.assertRaises(AssertionError, self.assertEquals, i1, i2) - self.assertRaises(AssertionError, self.failUnlessEqual, i1, i2) - self.assertRaises(AssertionError, self.failUnlessEqual, i1, i2) + self.assertRaises(AssertionError, self.assertEqual, i1, i2) + self.assertRaises(AssertionError, self.assertEqual, i1, i2) + self.assertRaises(AssertionError, self.assertEqual, i1, i2) + self.assertRaises(AssertionError, self.assertEqual, i1, i2) self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) - self.assertRaises(AssertionError, self.assertNotEquals, i1, i2) - self.assertRaises(AssertionError, self.assertNotEquals, i1, i2) - self.assertRaises(AssertionError, self.failIfEqual, i1, i2) - self.assertRaises(AssertionError, self.failIfEqual, i1, i2) + self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) + self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) + self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) + self.assertRaises(AssertionError, self.assertNotEqual, i1, i2) def testAllComparisonsSucceed(self): def testAllComparisonsSucceed(self): a = self.AllSame() a = self.AllSame() @@ -1428,11 +1428,11 @@ @@ -1428,11 +1428,11 @@ self.assertTrue(a == b) self.assertTrue(a == b) self.assertFalse(a != b) self.assertFalse(a != b) self.assertEqual(a, b) self.assertEqual(a, b) - self.assertEquals(a, b) - self.assertEquals(a, b) - self.failUnlessEqual(a, b) - self.failUnlessEqual(a, b) + self.assertEqual(a, b) + self.assertEqual(a, b) + self.assertEqual(a, b) + self.assertEqual(a, b) self.assertRaises(AssertionError, self.assertNotEqual, a, b) self.assertRaises(AssertionError, self.assertNotEqual, a, b) - self.assertRaises(AssertionError, self.assertNotEquals, a, b) - self.assertRaises(AssertionError, self.assertNotEquals, a, b) - self.assertRaises(AssertionError, self.failIfEqual, a, b) - self.assertRaises(AssertionError, self.failIfEqual, a, b) + self.assertRaises(AssertionError, self.assertNotEqual, a, b) + self.assertRaises(AssertionError, self.assertNotEqual, a, b) + self.assertRaises(AssertionError, self.assertNotEqual, a, b) + self.assertRaises(AssertionError, self.assertNotEqual, a, b) def _PerformAppleAppleOrangeChecks(self, same_a, same_b, different): def _PerformAppleAppleOrangeChecks(self, same_a, same_b, different): """Perform consistency checks with two apples and an orange. """Perform consistency checks with two apples and an orange. @@ -1449,8 +1449,8 @@ @@ -1449,8 +1449,8 @@ self.assertTrue(same_a == same_b) self.assertTrue(same_a == same_b) self.assertFalse(same_a != same_b) self.assertFalse(same_a != same_b) self.assertEqual(same_a, same_b) self.assertEqual(same_a, same_b) - self.assertEquals(same_a, same_b) - self.assertEquals(same_a, same_b) - self.failUnlessEqual(same_a, same_b) - self.failUnlessEqual(same_a, same_b) + self.assertEqual(same_a, same_b) + self.assertEqual(same_a, same_b) + self.assertEqual(same_a, same_b) + self.assertEqual(same_a, same_b) if PY_VERSION_2: if PY_VERSION_2: # Python 3 removes the global cmp function # Python 3 removes the global cmp function self.assertEqual(0, cmp(same_a, same_b)) self.assertEqual(0, cmp(same_a, same_b)) @@ -1458,16 +1458,16 @@ @@ -1458,16 +1458,16 @@ self.assertFalse(same_a == different) self.assertFalse(same_a == different) self.assertTrue(same_a != different) self.assertTrue(same_a != different) self.assertNotEqual(same_a, different) self.assertNotEqual(same_a, different) - self.assertNotEquals(same_a, different) - self.assertNotEquals(same_a, different) - self.failIfEqual(same_a, different) - self.failIfEqual(same_a, different) + self.assertNotEqual(same_a, different) + self.assertNotEqual(same_a, different) + self.assertNotEqual(same_a, different) + self.assertNotEqual(same_a, different) if PY_VERSION_2: if PY_VERSION_2: self.assertNotEqual(0, cmp(same_a, different)) self.assertNotEqual(0, cmp(same_a, different)) self.assertFalse(same_b == different) self.assertFalse(same_b == different) self.assertTrue(same_b != different) self.assertTrue(same_b != different) self.assertNotEqual(same_b, different) self.assertNotEqual(same_b, different) - self.assertNotEquals(same_b, different) - self.assertNotEquals(same_b, different) - self.failIfEqual(same_b, different) - self.failIfEqual(same_b, different) + self.assertNotEqual(same_b, different) + self.assertNotEqual(same_b, different) + self.assertNotEqual(same_b, different) + self.assertNotEqual(same_b, different) if PY_VERSION_2: if PY_VERSION_2: self.assertNotEqual(0, cmp(same_b, different)) self.assertNotEqual(0, cmp(same_b, different)) @@ -1565,7 +1565,7 @@ @@ -1565,7 +1565,7 @@ def __init__(self): # pylint: disable=super-init-not-called def __init__(self): # pylint: disable=super-init-not-called pass pass - Subclass().assertEquals({}, {}) - Subclass().assertEquals({}, {}) + Subclass().assertEqual({}, {}) + Subclass().assertEqual({}, {}) def testMultipleInheritance(self): def testMultipleInheritance(self): @@ -1577,7 +1577,7 @@ @@ -1577,7 +1577,7 @@ class Subclass(Foo, basetest.TestCase): class Subclass(Foo, basetest.TestCase): pass pass - Subclass().assertEquals({}, {}) - Subclass().assertEquals({}, {}) + Subclass().assertEqual({}, {}) + Subclass().assertEqual({}, {}) if __name__ == '__main__': if __name__ == '__main__': --- python3/tests/datelib_unittest.py (original) --- python3/tests/datelib_unittest.py (original) +++ python3/tests/datelib_unittest.py (refactored) +++ python3/tests/datelib_unittest.py (refactored) @@ -37,12 +37,12 @@ @@ -37,12 +37,12 @@ def testTzRandomConversion(self): def testTzRandomConversion(self): random.seed(self.seed) random.seed(self.seed) - for unused_i in xrange(100): - for unused_i in xrange(100): + for unused_i in range(100): + for unused_i in range(100): stz = pytz.timezone(random.choice(pytz.all_timezones)) stz = pytz.timezone(random.choice(pytz.all_timezones)) a = datelib.Timestamp.FromString('2008-04-12T10:00:00', stz) a = datelib.Timestamp.FromString('2008-04-12T10:00:00', stz) b = a b = a - for unused_j in xrange(100): - for unused_j in xrange(100): + for unused_j in range(100): + for unused_j in range(100): b = b.astimezone(pytz.timezone(random.choice(pytz.all_timezones))) b = b.astimezone(pytz.timezone(random.choice(pytz.all_timezones))) self.assertEqual(a, b) self.assertEqual(a, b) random.seed() random.seed() @@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@ IsEq(datelib.MAXIMUM_MICROSECOND_TIMESTAMP) IsEq(datelib.MAXIMUM_MICROSECOND_TIMESTAMP) random.seed(self.seed) random.seed(self.seed) - for _ in xrange(100): - for _ in xrange(100): + for _ in range(100): + for _ in range(100): IsEq(random.randint(0, datelib.MAXIMUM_MICROSECOND_TIMESTAMP)) IsEq(random.randint(0, datelib.MAXIMUM_MICROSECOND_TIMESTAMP)) def testMicroTimestampKnown(self): def testMicroTimestampKnown(self): @@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@ datelib.Timestamp.FromMicroTimestamp(b))) datelib.Timestamp.FromMicroTimestamp(b))) random.seed(self.seed) random.seed(self.seed) - for unused_i in xrange(100): - for unused_i in xrange(100): + for unused_i in range(100): + for unused_i in range(100): IsEq( IsEq( random.randint(0, datelib.MAXIMUM_MICROSECOND_TIMESTAMP), random.randint(0, datelib.MAXIMUM_MICROSECOND_TIMESTAMP), random.randint(0, datelib.MAXIMUM_MICROSECOND_TIMESTAMP)) random.randint(0, datelib.MAXIMUM_MICROSECOND_TIMESTAMP)) @@ -130,7 +130,7 @@ @@ -130,7 +130,7 @@ startdate = datelib.US_PACIFIC.localize( startdate = datelib.US_PACIFIC.localize( datelib.Timestamp(2009, 1, 1, 3, 0, 0, 0)) datelib.Timestamp(2009, 1, 1, 3, 0, 0, 0)) - for day in xrange(1, 366): - for day in xrange(1, 366): + for day in range(1, 366): + for day in range(1, 366): self.assertEqual( self.assertEqual( datelib.Timestamp.FromString(startdate.isoformat()), datelib.Timestamp.FromString(startdate.isoformat()), startdate, startdate, @@ -143,7 +143,7 @@ @@ -143,7 +143,7 @@ The result shall always be the same as tz.localize(naive_time). The result shall always be the same as tz.localize(naive_time). """ """ baseday = datelib.datetime.date(2009, 1, 1).toordinal() baseday = datelib.datetime.date(2009, 1, 1).toordinal() - for day_offset in xrange(0, 365): - for day_offset in xrange(0, 365): + for day_offset in range(0, 365): + for day_offset in range(0, 365): day = datelib.datetime.date.fromordinal(baseday + day_offset) day = datelib.datetime.date.fromordinal(baseday + day_offset) naive_day = datelib.datetime.datetime.combine( naive_day = datelib.datetime.datetime.combine( day, datelib.datetime.time(0, 45, 9)) day, datelib.datetime.time(0, 45, 9)) @@ -183,9 +183,9 @@ @@ -183,9 +183,9 @@ self.assertEqual( self.assertEqual( 0, datelib.DatetimeToUTCMicros(_EpochToDatetime(0))) 0, datelib.DatetimeToUTCMicros(_EpochToDatetime(0))) self.assertEqual( self.assertEqual( - 1001 * long(datelib._MICROSECONDS_PER_SECOND), - 1001 * long(datelib._MICROSECONDS_PER_SECOND), + 1001 * int(datelib._MICROSECONDS_PER_SECOND), + 1001 * int(datelib._MICROSECONDS_PER_SECOND), datelib.DatetimeToUTCMicros(_EpochToDatetime(1001))) datelib.DatetimeToUTCMicros(_EpochToDatetime(1001))) - self.assertEqual(long(self.now * datelib._MICROSECONDS_PER_SECOND), - self.assertEqual(long(self.now * datelib._MICROSECONDS_PER_SECOND), + self.assertEqual(int(self.now * datelib._MICROSECONDS_PER_SECOND), + self.assertEqual(int(self.now * datelib._MICROSECONDS_PER_SECOND), datelib.DatetimeToUTCMicros(_EpochToDatetime(self.now))) datelib.DatetimeToUTCMicros(_EpochToDatetime(self.now))) # tzinfo shouldn't change the result # tzinfo shouldn't change the result @@ -196,8 +196,8 @@ @@ -196,8 +196,8 @@ self.assertEqual( self.assertEqual( 0, datelib.DatetimeToUTCMillis(_EpochToDatetime(0))) 0, datelib.DatetimeToUTCMillis(_EpochToDatetime(0))) self.assertEqual( self.assertEqual( - 1001 * 1000L, datelib.DatetimeToUTCMillis(_EpochToDatetime(1001))) - 1001 * 1000L, datelib.DatetimeToUTCMillis(_EpochToDatetime(1001))) - self.assertEqual(long(self.now * 1000), - self.assertEqual(long(self.now * 1000), + 1001 * 1000, datelib.DatetimeToUTCMillis(_EpochToDatetime(1001))) + 1001 * 1000, datelib.DatetimeToUTCMillis(_EpochToDatetime(1001))) + self.assertEqual(int(self.now * 1000), + self.assertEqual(int(self.now * 1000), datelib.DatetimeToUTCMillis(_EpochToDatetime(self.now))) datelib.DatetimeToUTCMillis(_EpochToDatetime(self.now))) # tzinfo shouldn't change the result # tzinfo shouldn't change the result @@ -209,7 +209,7 @@ @@ -209,7 +209,7 @@ self.assertEqual(_EpochToDatetime(1.000001), self.assertEqual(_EpochToDatetime(1.000001), datelib.UTCMicrosToDatetime(1000001)) datelib.UTCMicrosToDatetime(1000001)) self.assertEqual(_EpochToDatetime(self.now), datelib.UTCMicrosToDatetime( self.assertEqual(_EpochToDatetime(self.now), datelib.UTCMicrosToDatetime( - long(self.now * datelib._MICROSECONDS_PER_SECOND))) - long(self.now * datelib._MICROSECONDS_PER_SECOND))) + int(self.now * datelib._MICROSECONDS_PER_SECOND))) + int(self.now * datelib._MICROSECONDS_PER_SECOND))) # Check timezone-aware comparisons # Check timezone-aware comparisons self.assertEqual(_EpochToDatetime(0, self.pst), self.assertEqual(_EpochToDatetime(0, self.pst), @@ -224,7 +224,7 @@ @@ -224,7 +224,7 @@ dt = _EpochToDatetime(t) dt = _EpochToDatetime(t) # truncate sub-milli time # truncate sub-milli time dt -= datelib.datetime.timedelta(microseconds=dt.microsecond % 1000) dt -= datelib.datetime.timedelta(microseconds=dt.microsecond % 1000) - self.assertEqual(dt, datelib.UTCMillisToDatetime(long(t * 1000))) - self.assertEqual(dt, datelib.UTCMillisToDatetime(long(t * 1000))) + self.assertEqual(dt, datelib.UTCMillisToDatetime(int(t * 1000))) + self.assertEqual(dt, datelib.UTCMillisToDatetime(int(t * 1000))) # Check timezone-aware comparisons # Check timezone-aware comparisons self.assertEqual(_EpochToDatetime(0, self.pst), self.assertEqual(_EpochToDatetime(0, self.pst), --- python3/tests/file_util_test.py (original) --- python3/tests/file_util_test.py (original) +++ python3/tests/file_util_test.py (refactored) +++ python3/tests/file_util_test.py (refactored) @@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@ RefactoringTool: Refactored python3/tests/humanize_test.py RefactoringTool: Refactored python3/tests/humanize_test.py RefactoringTool: No changes to python3/tests/resources_test.py RefactoringTool: No changes to python3/tests/resources_test.py RefactoringTool: No changes to python3/tests/sh_test.py RefactoringTool: No changes to python3/tests/sh_test.py RefactoringTool: No changes to python3/tests/shellutil_unittest.py RefactoringTool: No changes to python3/tests/shellutil_unittest.py RefactoringTool: No changes to python3/tests/stopwatch_unittest.py RefactoringTool: No changes to python3/tests/stopwatch_unittest.py RefactoringTool: Files that were modified: RefactoringTool: Files that were modified: RefactoringTool: python3/ez_setup.py RefactoringTool: python3/ez_setup.py RefactoringTool: python3/setup.py RefactoringTool: python3/setup.py RefactoringTool: python3/google/__init__.py RefactoringTool: python3/google/__init__.py RefactoringTool: python3/google/apputils/__init__.py RefactoringTool: python3/google/apputils/__init__.py RefactoringTool: python3/google/apputils/app.py RefactoringTool: python3/google/apputils/app.py RefactoringTool: python3/google/apputils/appcommands.py RefactoringTool: python3/google/apputils/appcommands.py RefactoringTool: python3/google/apputils/basetest.py RefactoringTool: python3/google/apputils/basetest.py RefactoringTool: python3/google/apputils/datelib.py RefactoringTool: python3/google/apputils/datelib.py RefactoringTool: python3/google/apputils/debug.py RefactoringTool: python3/google/apputils/debug.py RefactoringTool: python3/google/apputils/file_util.py RefactoringTool: python3/google/apputils/file_util.py RefactoringTool: python3/google/apputils/humanize.py RefactoringTool: python3/google/apputils/humanize.py RefactoringTool: python3/google/apputils/resources.py RefactoringTool: python3/google/apputils/resources.py RefactoringTool: python3/google/apputils/run_script_module.py RefactoringTool: python3/google/apputils/run_script_module.py -import __builtin__ -import __builtin__ +import builtins +import builtins import errno import errno import os import os import posix import posix @@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@ file_util.Write(self.file_path, 'original contents') file_util.Write(self.file_path, 'original contents') file_util.Write(self.file_path, self.sample_contents) file_util.Write(self.file_path, self.sample_contents) with open(self.file_path) as fp: with open(self.file_path) as fp: - self.assertEquals(fp.read(), self.sample_contents) - self.assertEquals(fp.read(), self.sample_contents) + self.assertEqual(fp.read(), self.sample_contents) + self.assertEqual(fp.read(), self.sample_contents) def testWriteExclusive(self): def testWriteExclusive(self): file_util.Write(self.file_path, 'original contents') file_util.Write(self.file_path, 'original contents') @@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@ self.sample_contents, overwrite_existing=False) self.sample_contents, overwrite_existing=False) def testWriteMode(self): def testWriteMode(self): - mode = 0744 - mode = 0744 + mode = 0o744 + mode = 0o744 file_util.Write(self.file_path, self.sample_contents, mode=mode) file_util.Write(self.file_path, self.sample_contents, mode=mode) s = os.stat(self.file_path) s = os.stat(self.file_path) self.assertEqual(stat.S_IMODE(s.st_mode), mode) self.assertEqual(stat.S_IMODE(s.st_mode), mode) @@ -80,10 +80,10 @@ @@ -80,10 +80,10 @@ def testAtomicWriteSuccessful(self): def testAtomicWriteSuccessful(self): file_util.AtomicWrite(self.file_path, self.sample_contents) file_util.AtomicWrite(self.file_path, self.sample_contents) with open(self.file_path) as fp: with open(self.file_path) as fp: - self.assertEquals(fp.read(), self.sample_contents) - self.assertEquals(fp.read(), self.sample_contents) + self.assertEqual(fp.read(), self.sample_contents) + self.assertEqual(fp.read(), self.sample_contents) def testAtomicWriteMode(self): def testAtomicWriteMode(self): - mode = 0745 - mode = 0745 + mode = 0o745 + mode = 0o745 file_util.AtomicWrite(self.file_path, self.sample_contents, mode=mode) file_util.AtomicWrite(self.file_path, self.sample_contents, mode=mode) s = os.stat(self.file_path) s = os.stat(self.file_path) self.assertEqual(stat.S_IMODE(s.st_mode), mode) self.assertEqual(stat.S_IMODE(s.st_mode), mode) @@ -125,7 +125,7 @@ @@ -125,7 +125,7 @@ self.mox.ReplayAll() self.mox.ReplayAll() try: try: - self.assertEquals(file_util.Read(self.file_path), self.sample_contents) - self.assertEquals(file_util.Read(self.file_path), self.sample_contents) + self.assertEqual(file_util.Read(self.file_path), self.sample_contents) + self.assertEqual(file_util.Read(self.file_path), self.sample_contents) self.mox.VerifyAll() self.mox.VerifyAll() finally: finally: # Because we mock out the built-in open() function, which the unittest # Because we mock out the built-in open() function, which the unittest @@ -142,7 +142,7 @@ @@ -142,7 +142,7 @@ self.mox.StubOutWithMock(os, 'chown') self.mox.StubOutWithMock(os, 'chown') gid = 'new gid' gid = 'new gid' os.open(self.file_path, os.O_WRONLY | os.O_TRUNC | os.O_CREAT, os.open(self.file_path, os.O_WRONLY | os.O_TRUNC | os.O_CREAT, - 0666).AndReturn(self.fd) - 0666).AndReturn(self.fd) + 0o666).AndReturn(self.fd) + 0o666).AndReturn(self.fd) os.write(self.fd, self.sample_contents) os.write(self.fd, self.sample_contents) os.close(self.fd) os.close(self.fd) os.chown(self.file_path, -1, gid) os.chown(self.file_path, -1, gid) @@ -211,7 +211,7 @@ @@ -211,7 +211,7 @@ file_util.AtomicWrite(self.file_path, self.sample_contents, file_util.AtomicWrite(self.file_path, self.sample_contents, mode=self.mode) mode=self.mode) except OSError as e: except OSError as e: - self.assertEquals(str(e), - self.assertEquals(str(e), + self.assertEqual(str(e), + self.assertEqual(str(e), 'A problem renaming!. Additional errors cleaning up: ' 'A problem renaming!. Additional errors cleaning up: ' 'A problem removing!') 'A problem removing!') else: else: @@ -244,7 +244,7 @@ @@ -244,7 +244,7 @@ temp_dirs = [] temp_dirs = [] self.assertRaises(Exception, Inner, temp_dirs) self.assertRaises(Exception, Inner, temp_dirs) # Ensure that the directory is removed on exit even when exceptions happen. # Ensure that the directory is removed on exit even when exceptions happen. - self.assertEquals(len(temp_dirs), 1) - self.assertEquals(len(temp_dirs), 1) + self.assertEqual(len(temp_dirs), 1) + self.assertEqual(len(temp_dirs), 1) self.assertFalse(os.path.isdir(temp_dirs[0])) self.assertFalse(os.path.isdir(temp_dirs[0])) def testTemporaryDirectory(self): def testTemporaryDirectory(self): @@ -281,10 +281,10 @@ @@ -281,10 +281,10 @@ def testNoErrorsAbsoluteOneDirWithForceMode(self): def testNoErrorsAbsoluteOneDirWithForceMode(self): # record, replay # record, replay os.mkdir('/foo') os.mkdir('/foo') - os.chmod('/foo', 0707) - os.chmod('/foo', 0707) - self.mox.ReplayAll() - self.mox.ReplayAll() - # test, verify - # test, verify - file_util.MkDirs('/foo', force_mode=0707) - file_util.MkDirs('/foo', force_mode=0707) + os.chmod('/foo', 0o707) + os.chmod('/foo', 0o707) + self.mox.ReplayAll() + self.mox.ReplayAll() + # test, verify + # test, verify + file_util.MkDirs('/foo', force_mode=0o707) + file_util.MkDirs('/foo', force_mode=0o707) self.mox.VerifyAll() self.mox.VerifyAll() def testNoErrorsExistingDirWithForceMode(self): def testNoErrorsExistingDirWithForceMode(self): @@ -295,7 +295,7 @@ @@ -295,7 +295,7 @@ os.path.isdir('/foo').AndReturn(True) os.path.isdir('/foo').AndReturn(True) self.mox.ReplayAll() self.mox.ReplayAll() # test, verify # test, verify - file_util.MkDirs('/foo', force_mode=0707) - file_util.MkDirs('/foo', force_mode=0707) + file_util.MkDirs('/foo', force_mode=0o707) + file_util.MkDirs('/foo', force_mode=0o707) self.mox.VerifyAll() self.mox.VerifyAll() def testNoErrorsAbsoluteSlashDot(self): def testNoErrorsAbsoluteSlashDot(self): @@ -331,10 +331,10 @@ @@ -331,10 +331,10 @@ os.mkdir('/foo').AndRaise(exist_error) # /foo exists os.mkdir('/foo').AndRaise(exist_error) # /foo exists os.path.isdir('/foo').AndReturn(True) os.path.isdir('/foo').AndReturn(True) os.mkdir('/foo/bar') # bar does not os.mkdir('/foo/bar') # bar does not - os.chmod('/foo/bar', 0707) - os.chmod('/foo/bar', 0707) - self.mox.ReplayAll() - self.mox.ReplayAll() - # test, verify - # test, verify - file_util.MkDirs('/foo/bar', force_mode=0707) - file_util.MkDirs('/foo/bar', force_mode=0707) + os.chmod('/foo/bar', 0o707) + os.chmod('/foo/bar', 0o707) + self.mox.ReplayAll() + self.mox.ReplayAll() + # test, verify + # test, verify + file_util.MkDirs('/foo/bar', force_mode=0o707) + file_util.MkDirs('/foo/bar', force_mode=0o707) self.mox.VerifyAll() self.mox.VerifyAll() def testNoErrorsRelativeOneDir(self): def testNoErrorsRelativeOneDir(self): --- python3/tests/humanize_test.py (original) --- python3/tests/humanize_test.py (original) +++ python3/tests/humanize_test.py (refactored) +++ python3/tests/humanize_test.py (refactored) @@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@ humanize.DecimalPrefix(-0.004, 'm', min_scale=None)) humanize.DecimalPrefix(-0.004, 'm', min_scale=None)) self.assertEqual('0 m', humanize.DecimalPrefix(0, 'm', min_scale=None)) self.assertEqual('0 m', humanize.DecimalPrefix(0, 'm', min_scale=None)) self.assertEqual( self.assertEqual( - u'1 µs', - u'1 µs', + '1 µs', + '1 µs', humanize.DecimalPrefix(0.0000013, 's', min_scale=None)) humanize.DecimalPrefix(0.0000013, 's', min_scale=None)) self.assertEqual('3 km', humanize.DecimalPrefix(3000, 'm', min_scale=None)) self.assertEqual('3 km', humanize.DecimalPrefix(3000, 'm', min_scale=None)) self.assertEqual( self.assertEqual( @@ -116,7 +116,7 @@ @@ -116,7 +116,7 @@ # Test both int and long versions of the same quantity to make sure they are # Test both int and long versions of the same quantity to make sure they are # printed in the same way. # printed in the same way. self.assertEqual('10.0 QPS', humanize.BinaryPrefix(10, 'QPS', precision=3)) self.assertEqual('10.0 QPS', humanize.BinaryPrefix(10, 'QPS', precision=3)) - self.assertEqual('10.0 QPS', humanize.BinaryPrefix(10L, 'QPS', precision=3)) - self.assertEqual('10.0 QPS', humanize.BinaryPrefix(10L, 'QPS', precision=3)) + self.assertEqual('10.0 QPS', humanize.BinaryPrefix(10, 'QPS', precision=3)) + self.assertEqual('10.0 QPS', humanize.BinaryPrefix(10, 'QPS', precision=3)) def testDecimalScale(self): def testDecimalScale(self): self.assertIsInstance(humanize.DecimalScale(0, '')[0], float) self.assertIsInstance(humanize.DecimalScale(0, '')[0], float) @@ -136,7 +136,7 @@ @@ -136,7 +136,7 @@ self.assertEqual((450, 'mSWE'), self.assertEqual((450, 'mSWE'), humanize.DecimalScale(0.45, 'SWE', min_scale=None)) humanize.DecimalScale(0.45, 'SWE', min_scale=None)) self.assertEqual( self.assertEqual( - (250, u'µm'), - (250, u'µm'), + (250, 'µm'), + (250, 'µm'), humanize.DecimalScale(1.0 / (4 * 1000), 'm', min_scale=None)) humanize.DecimalScale(1.0 / (4 * 1000), 'm', min_scale=None)) self.assertEqual( self.assertEqual( (0.250, 'km'), (0.250, 'km'), @@ -158,31 +158,31 @@ @@ -158,31 +158,31 @@ def testPrettyFraction(self): def testPrettyFraction(self): # No rounded integer part # No rounded integer part - self.assertEqual(u'½', humanize.PrettyFraction(0.5)) - self.assertEqual(u'½', humanize.PrettyFraction(0.5)) + self.assertEqual('½', humanize.PrettyFraction(0.5)) + self.assertEqual('½', humanize.PrettyFraction(0.5)) # Roundeded integer + fraction # Roundeded integer + fraction - self.assertEqual(u'6⅔', humanize.PrettyFraction(20.0 / 3.0)) - self.assertEqual(u'6⅔', humanize.PrettyFraction(20.0 / 3.0)) + self.assertEqual('6⅔', humanize.PrettyFraction(20.0 / 3.0)) + self.assertEqual('6⅔', humanize.PrettyFraction(20.0 / 3.0)) # Rounded integer, no fraction # Rounded integer, no fraction - self.assertEqual(u'2', humanize.PrettyFraction(2.00001)) - self.assertEqual(u'2', humanize.PrettyFraction(2.00001)) + self.assertEqual('2', humanize.PrettyFraction(2.00001)) + self.assertEqual('2', humanize.PrettyFraction(2.00001)) # No rounded integer, no fraction # No rounded integer, no fraction - self.assertEqual(u'0', humanize.PrettyFraction(0.001)) - self.assertEqual(u'0', humanize.PrettyFraction(0.001)) + self.assertEqual('0', humanize.PrettyFraction(0.001)) + self.assertEqual('0', humanize.PrettyFraction(0.001)) # Round up # Round up - self.assertEqual(u'1', humanize.PrettyFraction(0.99)) - self.assertEqual(u'1', humanize.PrettyFraction(0.99)) + self.assertEqual('1', humanize.PrettyFraction(0.99)) + self.assertEqual('1', humanize.PrettyFraction(0.99)) # No round up, edge case # No round up, edge case - self.assertEqual(u'⅞', humanize.PrettyFraction(0.9)) - self.assertEqual(u'⅞', humanize.PrettyFraction(0.9)) + self.assertEqual('⅞', humanize.PrettyFraction(0.9)) + self.assertEqual('⅞', humanize.PrettyFraction(0.9)) # Negative fraction # Negative fraction - self.assertEqual(u'-⅕', humanize.PrettyFraction(-0.2)) - self.assertEqual(u'-⅕', humanize.PrettyFraction(-0.2)) + self.assertEqual('-⅕', humanize.PrettyFraction(-0.2)) + self.assertEqual('-⅕', humanize.PrettyFraction(-0.2)) # Negative close to zero (should not be -0) # Negative close to zero (should not be -0) - self.assertEqual(u'0', humanize.PrettyFraction(-0.001)) - self.assertEqual(u'0', humanize.PrettyFraction(-0.001)) + self.assertEqual('0', humanize.PrettyFraction(-0.001)) + self.assertEqual('0', humanize.PrettyFraction(-0.001)) # Smallest fraction that should round down. # Smallest fraction that should round down. - self.assertEqual(u'0', humanize.PrettyFraction(1.0 / 16.0)) - self.assertEqual(u'0', humanize.PrettyFraction(1.0 / 16.0)) + self.assertEqual('0', humanize.PrettyFraction(1.0 / 16.0)) + self.assertEqual('0', humanize.PrettyFraction(1.0 / 16.0)) # Largest fraction should round up. # Largest fraction should round up. - self.assertEqual(u'1', humanize.PrettyFraction(15.0 / 16.0)) - self.assertEqual(u'1', humanize.PrettyFraction(15.0 / 16.0)) + self.assertEqual('1', humanize.PrettyFraction(15.0 / 16.0)) + self.assertEqual('1', humanize.PrettyFraction(15.0 / 16.0)) # Integer zero. # Integer zero. - self.assertEqual(u'0', humanize.PrettyFraction(0)) - self.assertEqual(u'0', humanize.PrettyFraction(0)) + self.assertEqual('0', humanize.PrettyFraction(0)) + self.assertEqual('0', humanize.PrettyFraction(0)) # Check that division yields fraction # Check that division yields fraction - self.assertEqual(u'⅘', humanize.PrettyFraction(4.0 / 5.0)) - self.assertEqual(u'⅘', humanize.PrettyFraction(4.0 / 5.0)) + self.assertEqual('⅘', humanize.PrettyFraction(4.0 / 5.0)) + self.assertEqual('⅘', humanize.PrettyFraction(4.0 / 5.0)) # Custom spacer. # Custom spacer. - self.assertEqual(u'2 ½', humanize.PrettyFraction(2.5, spacer=' ')) - self.assertEqual(u'2 ½', humanize.PrettyFraction(2.5, spacer=' ')) + self.assertEqual('2 ½', humanize.PrettyFraction(2.5, spacer=' ')) + self.assertEqual('2 ½', humanize.PrettyFraction(2.5, spacer=' ')) def testDuration(self): def testDuration(self): self.assertEqual('2h', humanize.Duration(7200)) self.assertEqual('2h', humanize.Duration(7200)) RefactoringTool: python3/google/apputils/setup_command.py RefactoringTool: python3/google/apputils/setup_command.py RefactoringTool: python3/google/apputils/shellutil.py RefactoringTool: python3/google/apputils/shellutil.py RefactoringTool: python3/google/apputils/stopwatch.py RefactoringTool: python3/google/apputils/stopwatch.py RefactoringTool: python3/tests/app_test.py RefactoringTool: python3/tests/app_test.py RefactoringTool: python3/tests/app_test_helper.py RefactoringTool: python3/tests/app_test_helper.py RefactoringTool: python3/tests/appcommands_example.py RefactoringTool: python3/tests/appcommands_example.py RefactoringTool: python3/tests/basetest_test.py RefactoringTool: python3/tests/basetest_test.py RefactoringTool: python3/tests/datelib_unittest.py RefactoringTool: python3/tests/datelib_unittest.py RefactoringTool: python3/tests/file_util_test.py RefactoringTool: python3/tests/file_util_test.py RefactoringTool: python3/tests/humanize_test.py RefactoringTool: python3/tests/humanize_test.py RefactoringTool: python3/tests/resources_test.py RefactoringTool: python3/tests/resources_test.py RefactoringTool: python3/tests/sh_test.py RefactoringTool: python3/tests/sh_test.py RefactoringTool: python3/tests/shellutil_unittest.py RefactoringTool: python3/tests/shellutil_unittest.py RefactoringTool: python3/tests/stopwatch_unittest.py RefactoringTool: python3/tests/stopwatch_unittest.py + exit 0 + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.l4SAS8 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.l4SAS8 + umask 022 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD ~/build/BUILD/python-google-apputils-0.4.2/python2 ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2/python2 ~/build/BUILD/python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + pushd python2 + pushd python2 + /usr/bin/python2 setup.py build + /usr/bin/python2 setup.py build running build running build running build_py running build_py creating build creating build creating build/lib creating build/lib creating build/lib/google creating build/lib/google copying google/__init__.py -> build/lib/google copying google/__init__.py -> build/lib/google creating build/lib/google/apputils creating build/lib/google/apputils copying google/apputils/setup_command.py -> build/lib/google/apputils copying google/apputils/setup_command.py -> build/lib/google/apputils copying google/apputils/humanize.py -> build/lib/google/apputils copying google/apputils/humanize.py -> build/lib/google/apputils copying google/apputils/run_script_module.py -> build/lib/google/apputils copying google/apputils/run_script_module.py -> build/lib/google/apputils copying google/apputils/basetest.py -> build/lib/google/apputils copying google/apputils/basetest.py -> build/lib/google/apputils copying google/apputils/datelib.py -> build/lib/google/apputils copying google/apputils/datelib.py -> build/lib/google/apputils copying google/apputils/__init__.py -> build/lib/google/apputils copying google/apputils/__init__.py -> build/lib/google/apputils copying google/apputils/file_util.py -> build/lib/google/apputils copying google/apputils/file_util.py -> build/lib/google/apputils copying google/apputils/appcommands.py -> build/lib/google/apputils copying google/apputils/appcommands.py -> build/lib/google/apputils copying google/apputils/app.py -> build/lib/google/apputils copying google/apputils/app.py -> build/lib/google/apputils copying google/apputils/resources.py -> build/lib/google/apputils copying google/apputils/resources.py -> build/lib/google/apputils copying google/apputils/debug.py -> build/lib/google/apputils copying google/apputils/debug.py -> build/lib/google/apputils copying google/apputils/shellutil.py -> build/lib/google/apputils copying google/apputils/shellutil.py -> build/lib/google/apputils copying google/apputils/stopwatch.py -> build/lib/google/apputils copying google/apputils/stopwatch.py -> build/lib/google/apputils + popd + popd ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2/python3 ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2/python3 ~/build/BUILD/python-google-apputils-0.4.2 + pushd python3 + pushd python3 + /usr/bin/python3.6 setup.py build + /usr/bin/python3.6 setup.py build running build running build running build_py running build_py creating build creating build creating build/lib creating build/lib creating build/lib/google creating build/lib/google copying google/__init__.py -> build/lib/google copying google/__init__.py -> build/lib/google creating build/lib/google/apputils creating build/lib/google/apputils copying google/apputils/setup_command.py -> build/lib/google/apputils copying google/apputils/setup_command.py -> build/lib/google/apputils copying google/apputils/humanize.py -> build/lib/google/apputils copying google/apputils/humanize.py -> build/lib/google/apputils copying google/apputils/run_script_module.py -> build/lib/google/apputils copying google/apputils/run_script_module.py -> build/lib/google/apputils copying google/apputils/basetest.py -> build/lib/google/apputils copying google/apputils/basetest.py -> build/lib/google/apputils copying google/apputils/datelib.py -> build/lib/google/apputils copying google/apputils/datelib.py -> build/lib/google/apputils copying google/apputils/__init__.py -> build/lib/google/apputils copying google/apputils/__init__.py -> build/lib/google/apputils copying google/apputils/file_util.py -> build/lib/google/apputils copying google/apputils/file_util.py -> build/lib/google/apputils copying google/apputils/appcommands.py -> build/lib/google/apputils copying google/apputils/appcommands.py -> build/lib/google/apputils copying google/apputils/app.py -> build/lib/google/apputils copying google/apputils/app.py -> build/lib/google/apputils copying google/apputils/resources.py -> build/lib/google/apputils copying google/apputils/resources.py -> build/lib/google/apputils copying google/apputils/debug.py -> build/lib/google/apputils copying google/apputils/debug.py -> build/lib/google/apputils copying google/apputils/shellutil.py -> build/lib/google/apputils copying google/apputils/shellutil.py -> build/lib/google/apputils copying google/apputils/stopwatch.py -> build/lib/google/apputils copying google/apputils/stopwatch.py -> build/lib/google/apputils + popd + popd ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2 + exit 0 + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.BRiuEu Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.BRiuEu + umask 022 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 '!=' / ']' + '[' /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 + rm -rf /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 ++ dirname /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 ++ dirname /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 + mkdir -p /builddir/build/BUILDROOT + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 + mkdir /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 + cd python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2/python3 ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2/python3 ~/build/BUILD/python-google-apputils-0.4.2 + pushd python3 + pushd python3 + /usr/bin/python3.6 setup.py install --skip-build --root /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 + /usr/bin/python3.6 setup.py install --skip-build --root /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 running install running install running install_lib running install_lib Skipping installation of /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/__init__.py (namespace package) Skipping installation of /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/__init__.py (namespace package) copying google/apputils/stopwatch.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/stopwatch.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/shellutil.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/shellutil.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/debug.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/debug.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/resources.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/resources.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/app.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/app.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/appcommands.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/appcommands.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/file_util.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/file_util.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/__init__.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/__init__.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/datelib.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/datelib.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/basetest.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/basetest.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/run_script_module.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/run_script_module.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/humanize.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/humanize.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/setup_command.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils copying google/apputils/setup_command.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/stopwatch.py to stopwatch.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/stopwatch.py to stopwatch.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/shellutil.py to shellutil.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/shellutil.py to shellutil.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/debug.py to debug.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/debug.py to debug.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/resources.py to resources.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/resources.py to resources.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/app.py to app.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/app.py to app.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/appcommands.py to appcommands.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/appcommands.py to appcommands.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/file_util.py to file_util.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/file_util.py to file_util.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/__init__.py to __init__.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/__init__.py to __init__.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/datelib.py to datelib.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/datelib.py to datelib.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/basetest.py to basetest.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/basetest.py to basetest.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/run_script_module.py to run_script_module.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/run_script_module.py to run_script_module.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/humanize.py to humanize.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/humanize.py to humanize.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/setup_command.py to setup_command.cpython-36.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google/apputils/setup_command.py to setup_command.cpython-36.pyc running install_egg_info running install_egg_info running egg_info running egg_info writing google_apputils.egg-info/PKG-INFO writing google_apputils.egg-info/PKG-INFO writing dependency_links to google_apputils.egg-info/dependency_links.txt writing dependency_links to google_apputils.egg-info/dependency_links.txt writing entry points to google_apputils.egg-info/entry_points.txt writing entry points to google_apputils.egg-info/entry_points.txt writing namespace_packages to google_apputils.egg-info/namespace_packages.txt writing namespace_packages to google_apputils.egg-info/namespace_packages.txt writing requirements to google_apputils.egg-info/requires.txt writing requirements to google_apputils.egg-info/requires.txt writing top-level names to google_apputils.egg-info/top_level.txt writing top-level names to google_apputils.egg-info/top_level.txt reading manifest file 'google_apputils.egg-info/SOURCES.txt' reading manifest file 'google_apputils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' reading manifest template 'MANIFEST.in' writing manifest file 'google_apputils.egg-info/SOURCES.txt' writing manifest file 'google_apputils.egg-info/SOURCES.txt' Copying google_apputils.egg-info to /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google_apputils-0.4.2-py3.6.egg-info Copying google_apputils.egg-info to /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google_apputils-0.4.2-py3.6.egg-info Installing /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google_apputils-0.4.2-py3.6-nspkg.pth Installing /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6/site-packages/google_apputils-0.4.2-py3.6-nspkg.pth running install_scripts running install_scripts + popd + popd ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2/python2 ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2/python2 ~/build/BUILD/python-google-apputils-0.4.2 + pushd python2 + pushd python2 + /usr/bin/python2 setup.py install --skip-build --root /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 + /usr/bin/python2 setup.py install --skip-build --root /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 running install running install running install_lib running install_lib Skipping installation of /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/__init__.py (namespace package) Skipping installation of /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/__init__.py (namespace package) copying google/apputils/stopwatch.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/stopwatch.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/shellutil.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/shellutil.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/debug.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/debug.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/resources.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/resources.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/app.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/app.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/appcommands.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/appcommands.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/file_util.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/file_util.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/__init__.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/__init__.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/datelib.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/datelib.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/basetest.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/basetest.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/run_script_module.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/run_script_module.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/humanize.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/humanize.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/setup_command.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils copying google/apputils/setup_command.py -> /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/stopwatch.py to stopwatch.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/stopwatch.py to stopwatch.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/shellutil.py to shellutil.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/shellutil.py to shellutil.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/debug.py to debug.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/debug.py to debug.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/resources.py to resources.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/resources.py to resources.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/app.py to app.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/app.py to app.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/appcommands.py to appcommands.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/appcommands.py to appcommands.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/file_util.py to file_util.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/file_util.py to file_util.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/__init__.py to __init__.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/__init__.py to __init__.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/datelib.py to datelib.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/datelib.py to datelib.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/basetest.py to basetest.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/basetest.py to basetest.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/run_script_module.py to run_script_module.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/run_script_module.py to run_script_module.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/humanize.py to humanize.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/humanize.py to humanize.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/setup_command.py to setup_command.pyc byte-compiling /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google/apputils/setup_command.py to setup_command.pyc running install_egg_info running install_egg_info running egg_info running egg_info writing requirements to google_apputils.egg-info/requires.txt writing requirements to google_apputils.egg-info/requires.txt writing google_apputils.egg-info/PKG-INFO writing google_apputils.egg-info/PKG-INFO writing namespace_packages to google_apputils.egg-info/namespace_packages.txt writing namespace_packages to google_apputils.egg-info/namespace_packages.txt writing top-level names to google_apputils.egg-info/top_level.txt writing top-level names to google_apputils.egg-info/top_level.txt writing dependency_links to google_apputils.egg-info/dependency_links.txt writing dependency_links to google_apputils.egg-info/dependency_links.txt writing entry points to google_apputils.egg-info/entry_points.txt writing entry points to google_apputils.egg-info/entry_points.txt reading manifest file 'google_apputils.egg-info/SOURCES.txt' reading manifest file 'google_apputils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' reading manifest template 'MANIFEST.in' writing manifest file 'google_apputils.egg-info/SOURCES.txt' writing manifest file 'google_apputils.egg-info/SOURCES.txt' Copying google_apputils.egg-info to /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google_apputils-0.4.2-py2.7.egg-info Copying google_apputils.egg-info to /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google_apputils-0.4.2-py2.7.egg-info Installing /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google_apputils-0.4.2-py2.7-nspkg.pth Installing /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7/site-packages/google_apputils-0.4.2-py2.7-nspkg.pth running install_scripts running install_scripts + popd + popd ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2 + /usr/lib/rpm/find-debuginfo.sh -j2 --strict-build-id -m -i --build-id-seed 0.4.2-16.el8 --unique-debug-suffix -0.4.2-16.el8.x86_64 --unique-debug-src-base python-google-apputils-0.4.2-16.el8.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /builddir/build/BUILD/python-google-apputils-0.4.2 + /usr/lib/rpm/find-debuginfo.sh -j2 --strict-build-id -m -i --build-id-seed 0.4.2-16.el8 --unique-debug-suffix -0.4.2-16.el8.x86_64 --unique-debug-src-base python-google-apputils-0.4.2-16.el8.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /builddir/build/BUILD/python-google-apputils-0.4.2 find: 'debug': No such file or directory find: 'debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/redhat/brp-ldconfig /sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory /sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-python-bytecompile 1 + /usr/lib/rpm/brp-python-bytecompile 1 Bytecompiling .py files below /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7 using /usr/bin/python2.7 Bytecompiling .py files below /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python2.7 using /usr/bin/python2.7 Bytecompiling .py files below /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6 using /usr/libexec/platform-python Bytecompiling .py files below /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/lib/python3.6 using /usr/libexec/platform-python + /usr/lib/rpm/brp-python-hardlink + /usr/lib/rpm/brp-python-hardlink + PYTHON3=/usr/bin/python3.6 + PYTHON3=/usr/bin/python3.6 + /usr/lib/rpm/redhat/brp-mangle-shebangs + /usr/lib/rpm/redhat/brp-mangle-shebangs Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.MERndT Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.MERndT + umask 022 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD ~/build/BUILD/python-google-apputils-0.4.2/python2 ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2/python2 ~/build/BUILD/python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + pushd python2 + pushd python2 + /usr/bin/python2 setup.py test + /usr/bin/python2 setup.py test running test running test running egg_info running egg_info writing requirements to google_apputils.egg-info/requires.txt writing requirements to google_apputils.egg-info/requires.txt writing google_apputils.egg-info/PKG-INFO writing google_apputils.egg-info/PKG-INFO writing namespace_packages to google_apputils.egg-info/namespace_packages.txt writing namespace_packages to google_apputils.egg-info/namespace_packages.txt writing top-level names to google_apputils.egg-info/top_level.txt writing top-level names to google_apputils.egg-info/top_level.txt writing dependency_links to google_apputils.egg-info/dependency_links.txt writing dependency_links to google_apputils.egg-info/dependency_links.txt writing entry points to google_apputils.egg-info/entry_points.txt writing entry points to google_apputils.egg-info/entry_points.txt reading manifest file 'google_apputils.egg-info/SOURCES.txt' reading manifest file 'google_apputils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' reading manifest template 'MANIFEST.in' writing manifest file 'google_apputils.egg-info/SOURCES.txt' writing manifest file 'google_apputils.egg-info/SOURCES.txt' running build_ext running build_ext ---------------------------------------------------------------------- ---------------------------------------------------------------------- Ran 0 tests in 0.000s Ran 0 tests in 0.000s OK OK + popd + popd ~/build/BUILD/python-google-apputils-0.4.2 ~/build/BUILD/python-google-apputils-0.4.2 + exit 0 + exit 0 Processing files: python2-google-apputils-0.4.2-16.el8.noarch Processing files: python2-google-apputils-0.4.2-16.el8.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.x1lPhi Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.x1lPhi + umask 022 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + cd python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + DOCDIR=/builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + DOCDIR=/builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + export LC_ALL=C + export LC_ALL=C + LC_ALL=C + LC_ALL=C + export DOCDIR + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + cp -pr python2/README /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + cp -pr python2/README /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + exit 0 + exit 0 Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.ytubnH Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.ytubnH + umask 022 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + cd python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + LICENSEDIR=/builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + LICENSEDIR=/builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + export LC_ALL=C + export LC_ALL=C + LC_ALL=C + LC_ALL=C + export LICENSEDIR + export LICENSEDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + cp -pr python2/LICENSE /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + cp -pr python2/LICENSE /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + exit 0 + exit 0 Provides: python2-google-apputils = 0.4.2-16.el8 python2.7dist(google-apputils) = 0.4.2 python2dist(google-apputils) = 0.4.2 Provides: python2-google-apputils = 0.4.2-16.el8 python2.7dist(google-apputils) = 0.4.2 python2dist(google-apputils) = 0.4.2 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: python(abi) = 2.7 python2.7dist(python-dateutil) >= 1.4 python2.7dist(python-gflags) >= 1.4 python2.7dist(pytz) Requires: python(abi) = 2.7 python2.7dist(python-dateutil) >= 1.4 python2.7dist(python-gflags) >= 1.4 python2.7dist(pytz) Processing files: python3-google-apputils-0.4.2-16.el8.noarch Processing files: python3-google-apputils-0.4.2-16.el8.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.Ll3E1e Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.Ll3E1e + umask 022 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + cd python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + DOCDIR=/builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + DOCDIR=/builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + export LC_ALL=C + export LC_ALL=C + LC_ALL=C + LC_ALL=C + export DOCDIR + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + cp -pr python3/README /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + cp -pr python3/README /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/doc/python-google-apputils + exit 0 + exit 0 Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.Gm81GM Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.Gm81GM + umask 022 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + cd python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + LICENSEDIR=/builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + LICENSEDIR=/builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + export LC_ALL=C + export LC_ALL=C + LC_ALL=C + LC_ALL=C + export LICENSEDIR + export LICENSEDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + cp -pr python3/LICENSE /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + cp -pr python3/LICENSE /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64/usr/share/licenses/python-google-apputils + exit 0 + exit 0 Provides: python3-google-apputils = 0.4.2-16.el8 python3.6dist(google-apputils) = 0.4.2 python3dist(google-apputils) = 0.4.2 Provides: python3-google-apputils = 0.4.2-16.el8 python3.6dist(google-apputils) = 0.4.2 python3dist(google-apputils) = 0.4.2 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: python(abi) = 3.6 python3.6dist(python-dateutil) >= 1.4 python3.6dist(python-gflags) >= 1.4 python3.6dist(pytz) Requires: python(abi) = 3.6 python3.6dist(python-dateutil) >= 1.4 python3.6dist(python-gflags) >= 1.4 python3.6dist(pytz) Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 Wrote: /builddir/build/RPMS/python2-google-apputils-0.4.2-16.el8.noarch.rpm Wrote: /builddir/build/RPMS/python2-google-apputils-0.4.2-16.el8.noarch.rpm Wrote: /builddir/build/RPMS/python3-google-apputils-0.4.2-16.el8.noarch.rpm Wrote: /builddir/build/RPMS/python3-google-apputils-0.4.2-16.el8.noarch.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.cZ9nlt Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.cZ9nlt + umask 022 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + cd python-google-apputils-0.4.2 + cd python-google-apputils-0.4.2 + /usr/bin/rm -rf /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 + /usr/bin/rm -rf /builddir/build/BUILDROOT/python-google-apputils-0.4.2-16.el8.x86_64 + exit 0 + exit 0 Child return code was: 0 Child return code was: 0