mirror of https://github.com/borgbackup/borg.git
Fix subsubparsers for Python <3.4.3
This works around http://bugs.python.org/issue9351 Since Debian and Ubuntu ship 3.4.2 and 3.4.0 respectively.
This commit is contained in:
parent
0b32524cda
commit
91991988e1
|
@ -1160,7 +1160,7 @@ class Archiver:
|
||||||
help='manage repository key')
|
help='manage repository key')
|
||||||
|
|
||||||
key_parsers = subparser.add_subparsers(title='required arguments', metavar='<command>')
|
key_parsers = subparser.add_subparsers(title='required arguments', metavar='<command>')
|
||||||
subparser.set_defaults(func=functools.partial(self.do_subcommand_help, subparser))
|
subparser.set_defaults(fallback_func=functools.partial(self.do_subcommand_help, subparser))
|
||||||
|
|
||||||
key_export_epilog = textwrap.dedent("""
|
key_export_epilog = textwrap.dedent("""
|
||||||
If repository encryption is used, the repository is inaccessible
|
If repository encryption is used, the repository is inaccessible
|
||||||
|
@ -1694,7 +1694,7 @@ class Archiver:
|
||||||
help='debugging command (not intended for normal use)')
|
help='debugging command (not intended for normal use)')
|
||||||
|
|
||||||
debug_parsers = subparser.add_subparsers(title='required arguments', metavar='<command>')
|
debug_parsers = subparser.add_subparsers(title='required arguments', metavar='<command>')
|
||||||
subparser.set_defaults(func=functools.partial(self.do_subcommand_help, subparser))
|
subparser.set_defaults(fallback_func=functools.partial(self.do_subcommand_help, subparser))
|
||||||
|
|
||||||
debug_info_epilog = textwrap.dedent("""
|
debug_info_epilog = textwrap.dedent("""
|
||||||
This command displays some system information that might be useful for bug
|
This command displays some system information that might be useful for bug
|
||||||
|
@ -1902,11 +1902,13 @@ class Archiver:
|
||||||
def run(self, args):
|
def run(self, args):
|
||||||
os.umask(args.umask) # early, before opening files
|
os.umask(args.umask) # early, before opening files
|
||||||
self.lock_wait = args.lock_wait
|
self.lock_wait = args.lock_wait
|
||||||
setup_logging(level=args.log_level, is_serve=args.func == self.do_serve) # do not use loggers before this!
|
# This works around http://bugs.python.org/issue9351
|
||||||
|
func = getattr(args, 'func', None) or getattr(args, 'fallback_func')
|
||||||
|
setup_logging(level=args.log_level, is_serve=func == self.do_serve) # do not use loggers before this!
|
||||||
check_extension_modules()
|
check_extension_modules()
|
||||||
if is_slow_msgpack():
|
if is_slow_msgpack():
|
||||||
logger.warning("Using a pure-python msgpack! This will result in lower performance.")
|
logger.warning("Using a pure-python msgpack! This will result in lower performance.")
|
||||||
return args.func(args)
|
return func(args)
|
||||||
|
|
||||||
|
|
||||||
def sig_info_handler(sig_no, stack): # pragma: no cover
|
def sig_info_handler(sig_no, stack): # pragma: no cover
|
||||||
|
|
Loading…
Reference in New Issue