mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Retry rename of imported config directory
In case an AV program has locked the imported config directory on Windows, sigh.
This commit is contained in:
parent
f53fdebabd
commit
6ae397126b
@ -357,7 +357,11 @@ def import_data(importer, library_path_map, config_location=None, progress1=None
|
|||||||
raise
|
raise
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
shutil.rmtree(config_location)
|
shutil.rmtree(config_location)
|
||||||
os.rename(base_dir, config_location)
|
try:
|
||||||
|
os.rename(base_dir, config_location)
|
||||||
|
except EnvironmentError:
|
||||||
|
time.sleep(2)
|
||||||
|
os.rename(base_dir, config_location)
|
||||||
from calibre.gui2 import gprefs
|
from calibre.gui2 import gprefs
|
||||||
gprefs.refresh()
|
gprefs.refresh()
|
||||||
|
|
||||||
@ -420,5 +424,6 @@ def run_importer():
|
|||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
export(sys.argv[-1], progress1=print, progress2=print)
|
export(sys.argv[-1], progress1=print, progress2=print)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user