mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 17:50:21 +08:00
auto python version
This commit is contained in:
parent
5d70a911e5
commit
652db1caba
@ -5,11 +5,13 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from platform import python_version
|
||||||
|
|
||||||
env_path = os.getenv("VIRTUAL_ENV")
|
env_path = os.getenv("VIRTUAL_ENV")
|
||||||
if env_path is None:
|
if env_path is None:
|
||||||
env_path = Path(os.__file__).parent.parent.parent.as_posix()
|
env_path = Path(os.__file__).parent.parent.parent.as_posix()
|
||||||
nodriver_path = Path(env_path + "/lib/python3.12/site-packages/nodriver/cdp/network.py")
|
python_version = python_version().split(".")[0:2]
|
||||||
|
nodriver_path = Path(env_path + f"/lib/python{'.'.join(python_version)}/site-packages/nodriver/cdp/network.py")
|
||||||
if not nodriver_path.exists():
|
if not nodriver_path.exists():
|
||||||
msg = f"{nodriver_path} not found"
|
msg = f"{nodriver_path} not found"
|
||||||
raise FileNotFoundError(msg)
|
raise FileNotFoundError(msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user