mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
15 lines
338 B
Python
15 lines
338 B
Python
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def python_venv_executable() -> Path:
|
|
venv_path = os.environ.get('VIRTUAL_ENV')
|
|
|
|
if venv_path:
|
|
return Path(venv_path) / 'bin' / 'python'
|
|
elif sys.prefix != sys.base_prefix:
|
|
return Path(sys.prefix) / 'bin' / 'python'
|
|
else:
|
|
return Path(sys.executable)
|