h
This commit is contained in:
@@ -751,7 +751,7 @@ def main() -> int:
|
||||
if db_path.exists():
|
||||
try:
|
||||
import sqlite3
|
||||
with sqlite3.connect(str(db_path)) as conn:
|
||||
with sqlite3.connect(str(db_path), timeout=30.0) as conn:
|
||||
# We want to set store.hydrusnetwork.hydrus.<key>
|
||||
cur = conn.cursor()
|
||||
# Check if hydrusnetwork store exists
|
||||
|
||||
@@ -161,7 +161,7 @@ def update_medios_config(hydrus_path: Path) -> bool:
|
||||
try:
|
||||
import sqlite3
|
||||
import json
|
||||
with sqlite3.connect(str(db_path)) as conn:
|
||||
with sqlite3.connect(str(db_path), timeout=30.0) as conn:
|
||||
conn.row_factory = sqlite3.Row
|
||||
cur = conn.cursor()
|
||||
|
||||
|
||||
@@ -791,7 +791,19 @@ def main(argv: Optional[List[str]] = None) -> int:
|
||||
# and the user did not explicitly pass --venv. This matches the user's likely
|
||||
# intent when they called: <venv_python> scripts/run_client.py ...
|
||||
cur_py = Path(sys.executable)
|
||||
if args.venv is None and _is_running_in_virtualenv() and cur_py:
|
||||
|
||||
# However, if we've already found a repo-local venv and the current Python
|
||||
# is external to the repository, we do NOT prefer it yet - we'll verify the
|
||||
# repo-local one first. This prevents tools like Medios-Macina from
|
||||
# accidentally installing their own venv into the repo's services.
|
||||
cur_is_external = True
|
||||
try:
|
||||
if repo_root in cur_py.resolve().parents:
|
||||
cur_is_external = False
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if args.venv is None and _is_running_in_virtualenv() and cur_py and (not venv_py or not cur_is_external):
|
||||
# If current interpreter looks like a venv and can import required modules,
|
||||
# prefer it immediately rather than forcing the repo venv.
|
||||
req = find_requirements(repo_root)
|
||||
|
||||
Reference in New Issue
Block a user