mirror of
https://github.com/SuperClaude-Org/SuperClaude_Framework.git
synced 2025-12-17 17:56:46 +00:00
Update __main__.py
Signed-off-by: Mithun Gowda B <mithungowda.b7411@gmail.com>
This commit is contained in:
parent
1af243bffa
commit
67585af9a5
@ -18,11 +18,23 @@ import difflib
|
||||
from pathlib import Path
|
||||
from typing import Dict, Callable
|
||||
|
||||
# Add the 'setup' directory to the Python import path
|
||||
# Add the 'setup' directory to the Python import path (with deprecation-safe logic)
|
||||
import sys
|
||||
|
||||
try:
|
||||
# Python 3.9+ preferred modern way
|
||||
from importlib.resources import files, as_file
|
||||
with as_file(files("setup")) as resource:
|
||||
setup_dir = str(resource)
|
||||
except (ImportError, ModuleNotFoundError, AttributeError):
|
||||
# Fallback for Python < 3.9
|
||||
from pkg_resources import resource_filename
|
||||
setup_dir = resource_filename('setup', '')
|
||||
|
||||
# Add to sys.path
|
||||
sys.path.insert(0, str(setup_dir))
|
||||
|
||||
|
||||
# Try to import utilities from the setup package
|
||||
try:
|
||||
from setup.utils.ui import (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user