2018-10-31 19:34:40 +00:00
|
|
|
# coding=utf-8
|
|
|
|
|
|
|
|
import os
|
2019-06-11 18:45:48 +00:00
|
|
|
import sys
|
2022-05-01 12:00:20 +00:00
|
|
|
|
2019-10-08 01:18:24 +00:00
|
|
|
from shutil import rmtree
|
|
|
|
|
|
|
|
|
|
|
|
def clean_libs():
|
2022-05-01 12:00:20 +00:00
|
|
|
libs_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'libs')
|
2019-10-08 01:18:24 +00:00
|
|
|
|
|
|
|
# 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)
|
2019-10-08 01:39:20 +00:00
|
|
|
rmtree(module_path, ignore_errors=True)
|
2018-10-31 19:34:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
def set_libs():
|
2022-05-01 12:00:20 +00:00
|
|
|
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), '../libs/'))
|
2019-09-28 04:22:17 +00:00
|
|
|
|
2018-10-31 19:34:40 +00:00
|
|
|
|
2019-10-08 01:18:24 +00:00
|
|
|
clean_libs()
|
2018-10-31 19:34:40 +00:00
|
|
|
set_libs()
|