Skip to content

SG-38078 workaround with new function to import packages with pyside6 conflicts #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eduardoChaucaGallegos
Copy link
Contributor

@eduardoChaucaGallegos eduardoChaucaGallegos commented Apr 15, 2025

Description

Add support for safe_import from tk-framework-shotgunutils

This update introduces the safe_import utility into the Python Console's default environment, if available. This function allows safely importing and interacting with isolated modules in a subprocess, preventing conflicts (e.g., with PySide or native dependencies).

If the required version of tk-framework-shotgunutils is not available or lacks safe_import, a warning is logged and the variable is set to None.

related with shotgunsoftware/tk-framework-shotgunutils#165

Tests

image
image

@eduardoChaucaGallegos eduardoChaucaGallegos changed the title workaround with new function to import packages with pyside6 conflicts SG-38078 workaround with new function to import packages with pyside6 conflicts Apr 15, 2025
@eduardoChaucaGallegos eduardoChaucaGallegos requested a review from a team April 25, 2025 08:16
"tk-framework-shotgunutils is available, but does not contain 'safe_import'. "
"Are you using an outdated version of the framework?"
)
except Exception:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be more specific in the type of exception?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants