mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 10:12:38 +02:00
Add an import preference for vendored packages
Prefer importing packages from ./dangerzone/vendor, if there is one there, instead of using the system ones.
This commit is contained in:
parent
f61097e9b3
commit
ed55124a8b
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,13 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
try:
|
||||
from . import vendor # type: ignore [attr-defined]
|
||||
|
||||
sys.path.insert(0, vendor.__path__[0])
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
if "DANGERZONE_MODE" in os.environ:
|
||||
mode = os.environ["DANGERZONE_MODE"]
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue