Mock Version: 3.5
ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs  --target x86_64 --nodeps /builddir/build/SPECS/python-optcomplete.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64-1674312764.807274/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=<mockbuild.trace_decorator.getLog object at 0x7fc1df9f7a10>timeout=0uid=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.zd9fb43a:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--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.zd9fb43a:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--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', 'efce6185caa541a0bf713d2b223ed4e1', '-D', '/var/lib/mock/fedora-rawhide-x86_64-1674312764.807274/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.zd9fb43a:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--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;<mock-chroot>\\007"', '--setenv=PS1=<mock-chroot> \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bs  --target x86_64 --nodeps /builddir/build/SPECS/python-optcomplete.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0', 'SYSTEMD_SECCOMP': '0'} and shell False
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1674172800
Wrote: /builddir/build/SRPMS/python-optcomplete-1.2.1-14.fc38.src.rpm
Child return code was: 0
ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bb  --target x86_64 --nodeps /builddir/build/SPECS/python-optcomplete.spec'], chrootPath='/var/lib/mock/fedora-rawhide-x86_64-1674312764.807274/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=<mockbuild.trace_decorator.getLog object at 0x7fc1df9f7a10>timeout=0uid=1000gid=135user='mockbuild'nspawn_args=['--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.zd9fb43a:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--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.zd9fb43a:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--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', 'df771fe247984794bf79d45853e8e0b7', '-D', '/var/lib/mock/fedora-rawhide-x86_64-1674312764.807274/root', '-a', '-u', 'mockbuild', '--capability=cap_ipc_lock', '--rlimit=RLIMIT_NOFILE=10240', '--capability=cap_ipc_lock', '--bind=/tmp/mock-resolv.zd9fb43a:/etc/resolv.conf', '--bind=/dev/btrfs-control', '--bind=/dev/mapper/control', '--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;<mock-chroot>\\007"', '--setenv=PS1=<mock-chroot> \\s-\\v\\$ ', '--setenv=LANG=C.UTF-8', '--resolv-conf=off', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bb  --target x86_64 --nodeps /builddir/build/SPECS/python-optcomplete.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'C.UTF-8', 'SYSTEMD_NSPAWN_TMPFS_TMP': '0', 'SYSTEMD_SECCOMP': '0'} and shell False
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1674172800
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.ZZVz4S
+ umask 022
+ cd /builddir/build/BUILD
+ cd /builddir/build/BUILD
+ rm -rf python-optcomplete-1.2.1
+ /usr/bin/mkdir -p python-optcomplete-1.2.1
+ cd python-optcomplete-1.2.1
+ /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/python-optcomplete-1.2.1.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ cp -a blais-optcomplete-477883477317 python3
+ 2to3 --write --nobackups python3
/usr/bin/2to3:3: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
  from lib2to3.main import main
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored python3/setup.py
RefactoringTool: Refactored python3/lib/python/optcomplete.py
--- python3/setup.py	(original)
+++ python3/setup.py	(refactored)
@@ -11,7 +11,7 @@
 def read_version():
     try:
         return open('VERSION', 'r').readline().strip()
-    except IOError, e:
+    except IOError as e:
         raise SystemExit(
             "Error: you must run setup from the root directory (%s)" % str(e))
 
--- python3/lib/python/optcomplete.py	(original)
+++ python3/lib/python/optcomplete.py	(refactored)
@@ -147,7 +147,7 @@
             res = glob.glob(prefix + '*')
             res = [f + ['','/'][isdir(f)] for f in res] #add trailing slashes to directories
             if len(self.endings) > 0:
-                res = filter(lambda a: isdir(a) or a.endswith(tuple(self.endings)), res)
+                res = [a for a in res if isdir(a) or a.endswith(tuple(self.endings))]
             if len(res) == 1 and isdir(res[0]):
                 #return two options so that it completes the / but doesn't add a space
                 return [res[0] + 'a', res[0] + 'b']
@@ -166,7 +166,7 @@
 #            return "_dirs"
         else:
             res = glob.glob(prefix + '*')
-            res = filter(isdir, res)
+            res = list(filter(isdir, res))
             res = [f + '/' for f in res] #add trailing slashes
             if len(res) == 1:
                 #return two options so that it completes the / but doesn't add a space
@@ -193,11 +193,11 @@
     def __init__(self, regexlist, always_dirs=True):
         self.always_dirs = always_dirs
 
-        if isinstance(regexlist, types.StringType):
+        if isinstance(regexlist, bytes):
             regexlist = [regexlist]
         self.regexlist = []
         for r in regexlist:
-            if isinstance(r, types.StringType):
+            if isinstance(r, bytes):
                 r = re.compile(r)
             self.regexlist.append(r)
 
@@ -285,7 +285,7 @@
 
     # If we are not requested for complete, simply return silently, let the code
     # caller complete. This is the normal path of execution.
-    if not os.environ.has_key('OPTPARSE_AUTO_COMPLETE'):
+    if 'OPTPARSE_AUTO_COMPLETE' not in os.environ:
         return
     # After this point we should never return, only sys.exit(1)
 
@@ -310,7 +310,7 @@
 
     # zsh's bashcompinit does not pass COMP_WORDS, replace with
     # COMP_LINE for now...
-    if not os.environ.has_key('COMP_WORDS'):
+    if 'COMP_WORDS' not in os.environ:
         os.environ['COMP_WORDS'] = os.environ['COMP_LINE']
 
     cwords = os.environ['COMP_WORDS'].split()
@@ -327,11 +327,11 @@
     # If requested, try subcommand syntax to find an options parser for that
     # subcommand.
     if subcommands:
-        assert isinstance(subcommands, types.DictType)
+        assert isinstance(subcommands, dict)
         value = guess_first_nonoption(parser, subcommands)
         if value:
-            if isinstance(value, types.ListType) or \
-               isinstance(value, types.TupleType):
+            if isinstance(value, list) or \
+               isinstance(value, tuple):
                 parser = value[0]
                 if len(value) > 1 and value[1]:
                     # override completer for command if it is present.
@@ -347,7 +347,7 @@
                 # else no completions for that command object
             sys.exit(1)
         else: # suggest subcommands
-            completer = ListCompleter(subcommands.keys())
+            completer = ListCompleter(list(subcommands.keys()))
 
     # Look at previous word, if it is an option and it requires an argument,
     # check for a local completer.  If there is no completer, what follows
@@ -390,64 +390,64 @@
 
     # Options completion.
     if not optarg and (not prefix or prefix.startswith('-')):
-        completions += parser._short_opt.keys()
-        completions += parser._long_opt.keys()
+        completions += list(parser._short_opt.keys())
+        completions += list(parser._long_opt.keys())
         # Note: this will get filtered properly below.
 
     # File completion.
     if completer and (not prefix or not prefix.startswith('-')):
 
         # Call appropriate completer depending on type.
-        if isinstance(completer, types.StringType) or \
-               isinstance(completer, types.ListType) or \
-               isinstance(completer, types.TupleType):
+        if isinstance(completer, bytes) or \
+               isinstance(completer, list) or \
+               isinstance(completer, tuple):
 
             completer = FileCompleter(completer)
             completions = completer(os.getcwd(), cline, cpoint, prefix, suffix)
 
         elif isinstance(completer, types.FunctionType) or \
              isinstance(completer, types.LambdaType) or \
-             isinstance(completer, types.ClassType) or \
-             isinstance(completer, types.ObjectType):
+             isinstance(completer, type) or \
+             isinstance(completer, object):
             completions = completer(os.getcwd(), cline, cpoint, prefix, suffix)
 
     if isinstance(completions, str):
         # is a bash command, just run it
         if shell() in ("bash"): #TODO: zsh
-            print completions
+            print(completions)
         else:
             raise Exception("Commands are unsupported by this shell")
     else:
         # Filter using prefix.
         if prefix:
-            completions = sorted(filter(lambda x: x.startswith(prefix), completions))
+            completions = sorted([x for x in completions if x.startswith(prefix)])
         completions = [str(c) for c in completions]
         completions = ' '.join(completions)
         # Save results
         if shell() == "bash":
-            print 'COMPREPLY=(' + completions + ')'
+            print('COMPREPLY=(' + completions + ')')
 #        elif shell() == "zsh":
 #            #TODO: modify the zsh completer script to eval the result
 #            print 'reply=(' + completions + ')'
         else:
-            print completions
+            print(completions)
 
     # Print debug output (if needed).  You can keep a shell with 'tail -f' to
     # the log file to monitor what is happening.
     if debugfn:
         from pprint import pformat
         f = open(debugfn, 'a')
-        print >> f, '---------------------------------------------------------'
-        print >> f, 'CWORDS', cwords
-        print >> f, 'CLINE', cline
-        print >> f, 'CPOINT', cpoint
-        print >> f, 'CWORD', cword
-        print >> f, '\nShort options'
-        print >> f, pformat(parser._short_opt)
-        print >> f, '\nLong options'
-        print >> f, pformat(parser._long_opt)
-        print >> f, 'Prefix/Suffix:', prefix, suffix
-        print >> f, 'completions', completions
+        print('---------------------------------------------------------', file=f)
+        print('CWORDS', cwords, file=f)
+        print('CLINE', cline, file=f)
+        print('CPOINT', cpoint, file=f)
+        print('CWORD', cword, file=f)
+        print('\nShort options', file=f)
+        print(pformat(parser._short_opt), file=f)
+        print('\nLong options', file=f)
+        print(pformat(parser._long_opt), file=f)
+        print('Prefix/Suffix:', prefix, suffix, file=f)
+        print('completions', completions, file=f)
         f.close()
 
     # Exit with error code (we do not let the caller continue on purpose, this
@@ -522,15 +522,15 @@
 
 
 def test():
-    print extract_word("extraire un mot d'une phrase", 11)
-    print extract_word("extraire un mot d'une phrase", 12)
-    print extract_word("extraire un mot d'une phrase", 13)
-    print extract_word("extraire un mot d'une phrase", 14)
-    print extract_word("extraire un mot d'une phrase", 0)
-    print extract_word("extraire un mot d'une phrase", 28)
-    print extract_word("extraire un mot d'une phrase", 29)
-    print extract_word("extraire un mot d'une phrase", -2)
-    print extract_word("optcomplete-test do", 19)
+    print(extract_word("extraire un mot d'une phrase", 11))
+    print(extract_word("extraire un mot d'une phrase", 12))
+    print(extract_word("extraire un mot d'une phrase", 13))
+    print(extract_word("extraire un mot d'une phrase", 14))
RefactoringTool: Refactored python3/lib/python/optcomplete_timo.py
+    print(extract_word("extraire un mot d'une phrase", 0))
+    print(extract_word("extraire un mot d'une phrase", 28))
+    print(extract_word("extraire un mot d'une phrase", 29))
+    print(extract_word("extraire un mot d'une phrase", -2))
+    print(extract_word("optcomplete-test do", 19))
 
 if __name__ == '__main__':
     test()
--- python3/lib/python/optcomplete_timo.py	(original)
+++ python3/lib/python/optcomplete_timo.py	(refactored)
@@ -148,7 +148,7 @@
             res = glob.glob(prefix + '*')
             res = [f + ['','/'][isdir(f)] for f in res] #add trailing slashes to directories
             if len(self.endings) > 0:
-                res = filter(lambda a: isdir(a) or a.endswith(tuple(self.endings)), res)
+                res = [a for a in res if isdir(a) or a.endswith(tuple(self.endings))]
             if len(res) == 1 and isdir(res[0]):
                 #return two options so that it completes the / but doesn't add a space
                 return [res[0] + 'a', res[0] + 'b']
@@ -167,7 +167,7 @@
 #            return "_dirs"
         else:
             res = glob.glob(prefix + '*')
-            res = filter(isdir, res)
+            res = list(filter(isdir, res))
             res = [f + '/' for f in res] #add trailing slashes
             if len(res) == 1:
                 #return two options so that it completes the / but doesn't add a space
@@ -194,11 +194,11 @@
     def __init__(self, regexlist, always_dirs=True):
         self.always_dirs = always_dirs
 
-        if isinstance(regexlist, types.StringType):
+        if isinstance(regexlist, bytes):
             regexlist = [regexlist]
         self.regexlist = []
         for r in regexlist:
-            if isinstance(r, types.StringType):
+            if isinstance(r, bytes):
                 r = re.compile(r)
             self.regexlist.append(r)
 
@@ -292,7 +292,7 @@
 
     # If we are not requested for complete, simply return silently, let the code
     # caller complete. This is the normal path of execution.
-    if not os.environ.has_key('OPTPARSE_AUTO_COMPLETE'):
+    if 'OPTPARSE_AUTO_COMPLETE' not in os.environ:
         return
     # After this point we should never return, only sys.exit(1)
 
@@ -323,7 +323,7 @@
 
     # zsh's bashcompinit does not pass COMP_WORDS, replace with
     # COMP_LINE for now...
-    if not os.environ.has_key('COMP_WORDS'):
+    if 'COMP_WORDS' not in os.environ:
         os.environ['COMP_WORDS'] = os.environ['COMP_LINE']
 
     cwords = os.environ['COMP_WORDS'].split()
@@ -340,11 +340,11 @@
     # If requested, try subcommand syntax to find an options parser for that
     # subcommand.
     if subcommands:
-        assert isinstance(subcommands, types.DictType)
+        assert isinstance(subcommands, dict)
         value = guess_first_nonoption(parser, subcommands)
         if value:
-            if isinstance(value, types.ListType) or \
-               isinstance(value, types.TupleType):
+            if isinstance(value, list) or \
+               isinstance(value, tuple):
                 parser = value[0]
                 if len(value) > 1 and value[1]:
                     # override completer for command if it is present.
@@ -360,7 +360,7 @@
                 # else no completions for that command object
             sys.exit(1)
         else: # suggest subcommands
-            completer = ListCompleter(subcommands.keys())
+            completer = ListCompleter(list(subcommands.keys()))
 
     # Look at previous word, if it is an option and it requires an argument,
     # check for a local completer.  If there is no completer, what follows
@@ -403,15 +403,15 @@
 
     # Options completion.
     if not optarg and prefix.startswith('-'):
-        completions += parser._short_opt.keys()
-        completions += parser._long_opt.keys()
+        completions += list(parser._short_opt.keys())
+        completions += list(parser._long_opt.keys())
         # Note: this will get filtered properly below.
 
     # Argument/option value completion.
     elif completer:
 
         # positional arguments can take a list/tuple of argument types
-        if not optarg and isinstance(completer, (types.ListType, types.TupleType)):
+        if not optarg and isinstance(completer, (list, tuple)):
             arg_count = guess_arg_count()
             if arg_count == None: #some sort of parse error
                 completer = arg_completer
@@ -426,11 +426,11 @@
                     completer = arg_completer
 
         # Strings and lists are implicitly converted to file ending completers
-        if isinstance(completer, (types.StringType, types.ListType, types.TupleType)):
+        if isinstance(completer, (bytes, list, tuple)):
             completer = FileCompleter(completer)
 
         # Actually call the completer
-        if isinstance(completer, (types.FunctionType, types.LambdaType, types.ClassType, types.ObjectType)):
+        if isinstance(completer, (types.FunctionType, types.LambdaType, type, object)):
             completions = completer(os.getcwd(), cline, cpoint, prefix, suffix)
         else:
             raise Exception("Unknown completer type")
@@ -438,40 +438,40 @@
     if isinstance(completions, str):
         # is a bash command, just run it
         if shell() in ("bash"): #TODO: zsh
-            print completions
+            print(completions)
         else:
             raise Exception("Commands are unsupported by this shell")
     else:
         # Filter using prefix.
         completions = [str(c) for c in completions]
         if prefix:
-            completions = sorted(filter(lambda x: x.startswith(prefix), completions))
+            completions = sorted([x for x in completions if x.startswith(prefix)])
         completions = ' '.join(completions)
         # Save results
         if shell() == "bash":
-            print 'COMPREPLY=(' + completions + ')'
+            print('COMPREPLY=(' + completions + ')')
 #        elif shell() == "zsh":
 #            #TODO: modify the zsh completer script to eval the result
 #            print 'reply=(' + completions + ')'
         else:
-            print completions
+            print(completions)
 
     # Print debug output (if needed).  You can keep a shell with 'tail -f' to
     # the log file to monitor what is happening.
     if debugfn:
         from pprint import pformat
         f = open(debugfn, 'a')
-        print >> f, '---------------------------------------------------------'
-        print >> f, 'CWORDS', cwords
-        print >> f, 'CLINE', cline
-        print >> f, 'CPOINT', cpoint
-        print >> f, 'CWORD', cword
-        print >> f, '\nShort options'
-        print >> f, pformat(parser._short_opt)
-        print >> f, '\nLong options'
-        print >> f, pformat(parser._long_opt)
-        print >> f, 'Prefix/Suffix:', prefix, suffix
-        print >> f, 'completions', completions
+        print('---------------------------------------------------------', file=f)
+        print('CWORDS', cwords, file=f)
+        print('CLINE', cline, file=f)
+        print('CPOINT', cpoint, file=f)
+        print('CWORD', cword, file=f)
+        print('\nShort options', file=f)
+        print(pformat(parser._short_opt), file=f)
+        print('\nLong options', file=f)
+        print(pformat(parser._long_opt), file=f)
+        print('Prefix/Suffix:', prefix, suffix, file=f)
+        print('completions', completions, file=f)
         f.close()
 
     # Exit with error code (we do not let the caller continue on purpose, this
@@ -588,15 +588,15 @@
 
 
 def test():
-    print extract_word("extraire un mot d'une phrase", 11)
-    print extract_word("extraire un mot d'une phrase", 12)
-    print extract_word("extraire un mot d'une phrase", 13)
-    print extract_word("extraire un mot d'une phrase", 14)
-    print extract_word("extraire un mot d'une phrase", 0)
-    print extract_word("extraire un mot d'une phrase", 28)
-    print extract_word("extraire un mot d'une phrase", 29)
-    print extract_word("extraire un mot d'une phrase", -2)
-    print extract_word("optcomplete-test do", 19)
+    print(extract_word("extraire un mot d'une phrase", 11))
+    print(extract_word("extraire un mot d'une phrase", 12))
+    print(extract_word("extraire un mot d'une phrase", 13))
+    print(extract_word("extraire un mot d'une phrase", 14))
+    print(extract_word("extraire un mot d'une phrase", 0))
+    print(extract_word("extraire un mot d'une phrase", 28))
+    print(extract_word("extraire un mot d'une phrase", 29))
+    print(extract_word("extraire un mot d'une phrase", -2))
+    print(extract_word("optcomplete-test do", 19))
 
 if __name__ == '__main__':
     test()
RefactoringTool: Files that were modified:
RefactoringTool: python3/setup.py
RefactoringTool: python3/lib/python/optcomplete.py
RefactoringTool: python3/lib/python/optcomplete_timo.py
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.AP8mtZ
+ umask 022
+ cd /builddir/build/BUILD
~/build/BUILD/python-optcomplete-1.2.1/python3 ~/build/BUILD/python-optcomplete-1.2.1
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ VALAFLAGS=-g
+ export VALAFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes'
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ cd python-optcomplete-1.2.1
+ pushd python3
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes'
+ /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -sP'
/builddir/build/BUILD/python-optcomplete-1.2.1/python3/setup.py:9: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.core import setup
running build
running build_py
creating build
creating build/lib
copying lib/python/optcomplete.py -> build/lib
+ popd
~/build/BUILD/python-optcomplete-1.2.1
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.7cYT9r
+ umask 022
+ cd /builddir/build/BUILD
+ '[' /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64 '!=' / ']'
+ rm -rf /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64
++ dirname /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64
+ mkdir -p /builddir/build/BUILDROOT
+ mkdir /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'
+ export CFLAGS
~/build/BUILD/python-optcomplete-1.2.1/python3 ~/build/BUILD/python-optcomplete-1.2.1
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ VALAFLAGS=-g
+ export VALAFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes'
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ cd python-optcomplete-1.2.1
+ pushd python3
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes'
+ /usr/bin/python3 setup.py install -O1 --skip-build --root /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64 --prefix /usr
/builddir/build/BUILD/python-optcomplete-1.2.1/python3/setup.py:9: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.core import setup
running install
running install_lib
creating /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr
creating /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/lib
creating /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/lib/python3.11
creating /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/lib/python3.11/site-packages
copying build/lib/optcomplete.py -> /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/lib/python3.11/site-packages
byte-compiling /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/lib/python3.11/site-packages/optcomplete.py to optcomplete.cpython-311.pyc
writing byte-compilation script '/tmp/tmpfulqh7on.py'
/usr/bin/python3 -Wignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning /tmp/tmpfulqh7on.py
removing /tmp/tmpfulqh7on.py
running install_egg_info
Writing /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/lib/python3.11/site-packages/optcomplete-1.2.1-py3.11.egg-info
+ rm -rfv /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/bin/__pycache__
~/build/BUILD/python-optcomplete-1.2.1
+ popd
+ /usr/bin/find-debuginfo -j2 --strict-build-id -m -i --build-id-seed 1.2.1-14.fc38 --unique-debug-suffix -1.2.1-14.fc38.x86_64 --unique-debug-src-base python-optcomplete-1.2.1-14.fc38.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /builddir/build/BUILD/python-optcomplete-1.2.1
find: 'debug': No such file or directory
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
+ /usr/lib/rpm/brp-remove-la-files
+ env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j2
Bytecompiling .py files below /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/lib/python3.11 using python3.11
+ /usr/lib/rpm/redhat/brp-python-hardlink
Processing files: python3-optcomplete-1.2.1-14.fc38.noarch
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.hbV6Yd
+ umask 022
+ cd /builddir/build/BUILD
+ cd python-optcomplete-1.2.1
+ DOCDIR=/builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/doc/python3-optcomplete
+ export LC_ALL=C
+ LC_ALL=C
+ export DOCDIR
+ /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/doc/python3-optcomplete
+ cp -pr python3/CHANGES /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/doc/python3-optcomplete
+ cp -pr python3/CREDITS /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/doc/python3-optcomplete
+ cp -pr python3/doc/conditional.txt python3/doc/sample-output.txt /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/doc/python3-optcomplete
+ cp -pr python3/README /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/doc/python3-optcomplete
+ cp -pr python3/TODO /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/doc/python3-optcomplete
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.NjSqbT
+ umask 022
+ cd /builddir/build/BUILD
+ cd python-optcomplete-1.2.1
+ LICENSEDIR=/builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/licenses/python3-optcomplete
+ export LC_ALL=C
+ LC_ALL=C
+ export LICENSEDIR
+ /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/licenses/python3-optcomplete
+ cp -pr python3/COPYING /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64/usr/share/licenses/python3-optcomplete
+ RPM_EC=0
++ jobs -p
+ exit 0
Provides: python-optcomplete = 1.2.1-14.fc38 python3-optcomplete = 1.2.1-14.fc38 python3.11-optcomplete = 1.2.1-14.fc38 python3.11dist(optcomplete) = 1.2.1 python3dist(optcomplete) = 1.2.1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: python(abi) = 3.11
Obsoletes: python-optcomplete < 1.2.1-14.fc38
Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64
Wrote: /builddir/build/RPMS/python3-optcomplete-1.2.1-14.fc38.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.MAFNQx
+ umask 022
+ cd /builddir/build/BUILD
+ cd python-optcomplete-1.2.1
+ /usr/bin/rm -rf /builddir/build/BUILDROOT/python-optcomplete-1.2.1-14.fc38.x86_64
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(rmbuild): /bin/sh -e /var/tmp/rpm-tmp.BhCjIZ
+ umask 022
+ cd /builddir/build/BUILD
+ rm -rf python-optcomplete-1.2.1 python-optcomplete-1.2.1.gemspec
+ RPM_EC=0
++ jobs -p
+ exit 0
Child return code was: 0