From f507f0536e8d2e6f5a752968390565e3df645311 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 8 Aug 2024 01:45:52 +0200 Subject: [PATCH] check if not already there --- spcd/__main__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spcd/__main__.py b/spcd/__main__.py index c904941..6c62422 100755 --- a/spcd/__main__.py +++ b/spcd/__main__.py @@ -2,8 +2,8 @@ """Entry point.""" -import os import sys +from os import environ, pathsep import env @@ -12,7 +12,7 @@ if env.SPCD_PYTHON_VENV_PACKAGES not in sys.path: import spcd if __name__ == "__main__": - os.environ["PATH"] = os.pathsep.join( - [env.SPCD_PYTHON_VENV_BINARIES, os.environ["PATH"]] - ) + paths = environ["PATH"].split(pathsep) + if env.SPCD_PYTHON_VENV_BINARIES not in paths: + environ["PATH"] = pathsep.join([env.SPCD_PYTHON_VENV_BINARIES, *paths]) spcd.main(__file__)