mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-23 14:31:06 +00:00
Clean old module
This commit is contained in:
parent
3f772c96ef
commit
49c793cc89
1 changed files with 14 additions and 0 deletions
|
@ -2,6 +2,19 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from shutil import rmtree
|
||||||
|
|
||||||
|
|
||||||
|
def clean_libs():
|
||||||
|
libs_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'libs')
|
||||||
|
|
||||||
|
# Delete the old module almost empty directory compatible only with Python 2.7.x that cause bad magic number error
|
||||||
|
# if they are present in Python 3.x.
|
||||||
|
module_list = ['enum', 'concurrent']
|
||||||
|
for module in module_list:
|
||||||
|
module_path = os.path.join(libs_dir, module)
|
||||||
|
if os.path.isdir(module_path):
|
||||||
|
rmtree(module_path)
|
||||||
|
|
||||||
|
|
||||||
def set_libs():
|
def set_libs():
|
||||||
|
@ -13,4 +26,5 @@ def set_libs():
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../libs2/'))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../libs2/'))
|
||||||
|
|
||||||
|
|
||||||
|
clean_libs()
|
||||||
set_libs()
|
set_libs()
|
||||||
|
|
Loading…
Reference in a new issue