mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 06:22:48 +01:00
Main function closes its library
This commit is contained in:
parent
2f9aa41614
commit
574f3bc732
1 changed files with 4 additions and 0 deletions
|
|
@ -1233,6 +1233,7 @@ def _raw_main(args, lib=None):
|
|||
from beets.ui.commands import config_edit
|
||||
return config_edit()
|
||||
|
||||
test_lib = bool(lib)
|
||||
subcommands, plugins, lib = _setup(options, lib)
|
||||
parser.add_subcommand(*subcommands)
|
||||
|
||||
|
|
@ -1240,6 +1241,9 @@ def _raw_main(args, lib=None):
|
|||
subcommand.func(lib, suboptions, subargs)
|
||||
|
||||
plugins.send('cli_exit', lib=lib)
|
||||
if not test_lib:
|
||||
# Clean up the library unless it came from the test harness.
|
||||
lib._close()
|
||||
|
||||
|
||||
def main(args=None):
|
||||
|
|
|
|||
Loading…
Reference in a new issue