Skip to content

Commit

Permalink
use addsitedir
Browse files Browse the repository at this point in the history
Signed-off-by: minff <[email protected]>
  • Loading branch information
minff committed Feb 26, 2024
1 parent 74ee707 commit bcda674
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions XYZHubConnector/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import os
import sys
import site

from qgis.core import QgsApplication

Expand All @@ -34,10 +35,12 @@


def load_external_lib():
if EXTERNAL_LIB_DIR not in sys.path:
sys.path.insert(0, EXTERNAL_LIB_DIR)
site.addsitedir(EXTERNAL_LIB_DIR)
# if EXTERNAL_LIB_DIR not in sys.path:
# sys.path.insert(0, EXTERNAL_LIB_DIR)


def unload_external_lib():
if EXTERNAL_LIB_DIR in sys.path:
sys.path.remove(EXTERNAL_LIB_DIR)
pass # do nothing with addsitedir
# if EXTERNAL_LIB_DIR in sys.path:
# sys.path.remove(EXTERNAL_LIB_DIR)

0 comments on commit bcda674

Please sign in to comment.