From 041933e96bba36f001de2194b160b311d1da4110 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 4 Apr 2024 12:49:52 +0200 Subject: [PATCH] use pathlib instead --- client/ayon_core/cli.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/cli.py b/client/ayon_core/cli.py index 40227b63b8..80fbb57340 100644 --- a/client/ayon_core/cli.py +++ b/client/ayon_core/cli.py @@ -4,6 +4,7 @@ import os import sys import code import traceback +from pathlib import Path import click import acre @@ -178,10 +179,8 @@ def run(script): comp_path = os.path.join(os.environ["AYON_ROOT"], "start.py") else: comp_path = os.getenv("AYON_EXECUTABLE") - # Normalize paths for comparison - first_arg = os.path.normpath(first_arg).lower() - comp_path = os.path.normpath(comp_path).lower() - if first_arg == comp_path: + # Compare paths and remove first argument if it is the same as AYON + if Path(first_arg).resolve() == Path(comp_path).resolve(): sys.argv.pop(0) # Remove 'run' command from sys.argv