Resolved problem in virtualenv detection

Fix #1535
This commit is contained in:
Matheus Horstmann 2021-09-09 23:51:16 -03:00 committed by GitHub
parent 560398b44c
commit 35cb757df8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -45,8 +45,10 @@ import logging
def is_virtualenv():
# return True if Bazarr have been start from within a virtualenv or venv
base_prefix = getattr(sys, "base_prefix", None) or getattr(sys, "real_prefix", None) or sys.prefix
return base_prefix != sys.prefix
base_prefix = getattr(sys, "base_prefix", None)
# real_prefix will return None if not in a virtualenv enviroment or the default python path
real_prefix = getattr(sys, "real_prefix", None) or sys.prefix
return base_prefix != real_prefix
# deploy requirements.txt